lunes, 8 de octubre de 2012

Publishing ABAP Function Module as Web Service

Hi,

These is a good functionality that we can use instead of SAP .NET Connector to make Connections between our SAP System & Satelit Systems.

First we must have a Function Module or a defined BAPI, once we have these right click the object and a context menu appears, then press create->Web Service.

A Wizard shows up, then we must fill the first window data.
Choose EndPoint: Check the Name Mapping
Configure Service: As we are not require credentials, selects the PRF_DT_IF_SEC_NO Profile & Check the Deploy Service.

Finally as we are not requiring credentials to the consumer, we have to set an internal User, to do these we need to go transaction SICF, being there filter the service with the service that we assigned, double click the service and at the Tab Datos Logon.
In Transaction SOAMANAGER, Application and Scenario Communication Tab->Single Service Administration.
1. Filter By service.
2. Select the Service.
3.Click Apply Selection.
4.Select Configuration Tab.
At these point we have an Endpoint Created, but the Provider Security Tab is hidden so we are going to create other.
5.Click on Create EndPoint Button
6.Set the name
7.Communication Security: none
8.Authentication Settings: No Authentication
9.ABAP Service User: Fill user logon Data defined.

At these point we can consume the Service,

Hope it Helps,
Greetings.


Disable WebDynpro User Options Context Menu

Hi,

These time im going to publish something that take me a lot of time to find out the solution, althoug it is a simple parameter i know that this could save you all of time.

Introduction.
If we have a User Shared WebDynpro Module And the users does not need to hide-unhide parts of it, we could start having troubles because some user hides components that the other needs.

Solution.
What we can do is to Set an option parameter in the Application to disable personalization, the parameter is WDDISABLEUSERPERSONALIZATION With the value  X and type WDY_BOOLEAN, The description is Do Not Allow Personalization by the User.

Note:
Remember saving the modification in the language you need.

Hope this helps some one else,
Greetings

miércoles, 30 de noviembre de 2011

Filling with 0 (ceros) a field

Hi,

To do this task exists a function called CONVERSION_EXIT_ALPHA_INPUT that has only one input parameter and another for the result:

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = ls_selprod-Matnr
        IMPORTING
          output = ls_selprod-Matnr.


I have used this to fill parameters that must be passed into a BAPI.

& that's all,

Greetings.

jueves, 30 de junio de 2011

SALV with Drill Down to open an Invoice

To achieve this we need to handle the event double click so check first the post: SALV Handle double click

After doing that in the implementation part we only need to call the function RV_CALL_DISPLAY_TRANSACTION passing the vbeln that must be at the table mapped to the ALV:

CLASS lcl_handler IMPLEMENTATION.
METHOD on_double_click.
READ TABLE SALVTable INTO WA_SALVTable INDEX row.
IF sy-subrc = 0.
CALL FUNCTION 'RV_CALL_DISPLAY_TRANSACTION'
EXPORTING
vbeln = WA_SALVTable-vbeln.
ENDIF.
ENDMETHOD.
ENDCLASS.

SALV Handle double click

To andle the Double Click event of SALV, we need to declare a handler class:

Definition:

CLASS lcl_handler DEFINITION.
PUBLIC SECTION.
METHODS: on_double_click FOR EVENT DOUBLE_CLICK OF cl_salv_events_table
IMPORTING row column.
PRIVATE SECTION.
DATA: lr_data_tab TYPE REF TO data.
ENDCLASS.

The method handler returns the row and columns double clicked.

Implementation:

This is what the method must do after a row is double clicked, reading the table using the row as the index.

CLASS lcl_handler IMPLEMENTATION.
METHOD on_double_click.
READ TABLE SALVTable INTO WA_SALVTable INDEX row.
"...
"...
"...
ENDMETHOD.
ENDCLASS.

Then we need to declare the handler class and cl_salv_events_table class as REF TO

DATA: r_events TYPE REF TO cl_salv_events_table,
event_handler type ref to lcl_handler.

We gets the event object from the alv object created by factory method of cl_salv_table:

r_events = alv->get_event( ).

Then Create the event handler

CREATE OBJECT event_handler.

Sets the handler method for the ALV corresponding event

SET HANDLER event_handler->on_double_click FOR r_events.

We are finished.

SALV Set Light or Exception field

The table to be mapped must have a light field, the name does not matter, the possible colors are:
1.-Rojo,2.-Verde,3.-Amarillo

Example:
SalvTable-Light = 1."ROJO.

After constructing the ALV with factory method of cl_salv_table

cl_salv_table=>factory(
IMPORTING r_salv_table = alv
CHANGING t_table = SALVTable ).

g_columns = ALV->get_columns( ).
g_columns->set_exception_column( value = 'LIGHT' ).

SALV Row Colors

To set Color for a Row the table we are going to map to the ALV must have a field of type lvc_t_scol and fill the color structure:

Declare:

DATA: lt_s_color TYPE lvc_t_scol,
ls_s_color TYPE lvc_s_scol.

Fill structure

ls_s_color-color-int = 0. "Intensive
ls_s_color-color-inv = 0."Inverse
" 1 = grey/blue, 2=light grey, 3=yellow, 4=blue/green, 5= green, 6=red, 7=orange.
ls_s_color-color-col = 3."Color
APPEND ls_s_color TO lt_s_color.

Fill the Tab to be mapped,

WA_SALVTab-ROW_COLOUR = lt_s_color.
APPEND WA_SALVTab TO T_SALVTab.