jueves, 30 de junio de 2011

SALV Hide columns

Hi,

If we want to hide some columns from the ALV that come with the table mapped, we just need to set the column as technical executing the method SET_TECHNICAL to True:

g_column ?= g_columns->get_column( 'PROC_CODE' ).
g_column->SET_TECHNICAL( ABAP_TRUE ).

OR

Set the column visible property as False:

g_column ?= g_columns->get_column( 'MSGTYP' ).
g_column->SET_VISIBLE( ABAP_FALSE ).

Greetings.

miércoles, 29 de junio de 2011

SALV Set Header Column Text

Hi,

To Set the Text we want to be showed at the column header of one SALV we first need to have been declared some vars:

First our ALV object TYPE REF TO cl_salv_table
Then we need another one to be the column collection TYPE REF TO cl_salv_columns_table
Finally a csingle column var of TYPE REF TO cl_salv_column_table.

After that we now need to create the salv Object using the factory method of cl_salv_table Class, we need to the table that we want the Alv shows data.

Creating the SALV:

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

Now we are going to set the column header texts, getting first the column collection from the ALV object created:

g_columns = ALV->get_columns( ).
TRY.
g_columns->set_color_column( 'ROW_COLOUR' ).
g_columns->set_key_fixation( ).
CATCH cx_salv_data_error. "#EC NO_HANDLER
ENDTRY.

at this point we have a collection of columns, now we are going to find an especific column:

executing the get_column method passing the column field name mapped in the alv and saving the result to the column var.

g_column ?= g_columns->get_column( 'MESSAGE' ).

now we can set the header text for the MESSAGE column of the SALV, short,medium and long text:

g_column->set_short_text( value = 'Mensaje' ).
g_column->set_medium_text( value = 'Mensaje' ).
g_column->set_long_text( value = 'Mensaje' ).

hope it helps.

Consuming Web Service from URL/HTTP Destination

Hi,

We can use a Web service firstly declaring a Client Proxy at SE80
following this Enterprise Services-->Client Proxies-->Create

Selecting the option URL/HTTP Destination and then Continue, now we need to fill the URL where the service WSDL are and press continue.

Remember that the URL must have the domain name.

Insert the Package,Prefix, Request and continue, Configure and continue.

If the SAP version is ECC 6.0 or + then we have to configure the port at Tx. SOAMANAGER that opens the Default Web Browser with a SOA Management WebDynpro, select the Tab Application and Scenario Communication and then click in Single Service Administration, we are going to search by Proxy with pattern z* & press GO.

A Grid is filled out with a list of entities found, now we select the proxy and press Apply Selection Button, in the Tab Configurations we have to add a Logical Port by pressing Create Logical Port, then we havce to fill the port name,description and again insert the wsdl url finiching by pressing Apply Settings.

At the port created Config's Tab's I supressed the Message ID Protocol at Messaging Tab.

Now we can consume that Web Service throug the Logical Port of our Client Proxy, How to do it?

1.- Define some var_pxyName at the program of TYPE REF TO the proxy Name.
2.-Declare Input & Output vars of type Param Input & Output: ls_request, ls_response.
3.- Implement or Set the var using CREATE OBJECT var_pxyName
4.-Call the WS Method trough proxy, 
    CALL METHOD varProxyName->MyMethod
            EXPORTING
        INPUT = LS_REQUEST
      IMPORTING
        OUTPUT = ls_response .

5.- Finally we have to check the ls_response with the WS Result.

Greetings