SOAP Receiver to use operations and methods
Hi.
I have got a WSDL with 3 methods and I have to call one of them.
However, the SOAP Receiver adapter only has a Action section which can be maintained.
How can this be attained?
The WSDL I am using is as follows:
<?xml version="1.0" encoding="ISO-8859-1"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:tns="urn:uniface:applic:services:CSYV1000" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="urn:uniface:applic:services:CSYV1000" name="CSYV1000">
<wsdl:types />
<wsdl:message name="EXTERNALRequest">
<wsdl:part name="REQUEST" type="s:string" />
<wsdl:part name="REQUESTDATA" type="s:string" />
</wsdl:message>
<wsdl:message name="LOGOFFRequest">
<wsdl:part name="REQUEST" type="s:string" />
</wsdl:message>
<wsdl:message name="LOGONRequest">
<wsdl:part name="REQUEST" type="s:string" />
</wsdl:message>
<wsdl:message name="EXTERNALResponse">
<wsdl:part name="return" type="s:int" />
<wsdl:part name="RESPONSE" type="s:string" />
<wsdl:part name="RESPONSEDATA" type="s:string" />
<wsdl:part name="RESPONSEERROR" type="s:string" />
</wsdl:message>
<wsdl:message name="LOGOFFResponse">
<wsdl:part name="return" type="s:int" />
<wsdl:part name="RESPONSE" type="s:string" />
<wsdl:part name="RESPONSEERROR" type="s:string" />
</wsdl:message>
<wsdl:message name="LOGONResponse">
<wsdl:part name="return" type="s:int" />
<wsdl:part name="RESPONSE" type="s:string" />
<wsdl:part name="RESPONSEERROR" type="s:string" />
</wsdl:message>
<wsdl:portType name="CSYV1000PortType">
<wsdl:operation name="EXTERNAL" parameterOrder="REQUEST REQUESTDATA RESPONSE RESPONSEDATA RESPONSEERROR">
<wsdl:input message="tns:EXTERNALRequest" />
<wsdl:output message="tns:EXTERNALResponse" />
</wsdl:operation>
<wsdl:operation name="LOGOFF" parameterOrder="REQUEST RESPONSE RESPONSEERROR">
<wsdl:input message="tns:LOGOFFRequest" />
<wsdl:output message="tns:LOGOFFResponse" />
</wsdl:operation>
<wsdl:operation name="LOGON" parameterOrder="REQUEST RESPONSE RESPONSEERROR">
<wsdl:input message="tns:LOGONRequest" />
<wsdl:output message="tns:LOGONResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CSYV1000Binding" type="tns:CSYV1000PortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
<wsdl:operation name="EXTERNAL">
<soap:operation soapAction="" />
<wsdl:input>
<soap:body use="encoded" namespace="urn:uniface:applic:services:CSYV1000" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="urn:uniface:applic:services:CSYV1000" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="LOGOFF">
<soap:operation soapAction="" />
<wsdl:input>
<soap:body use="encoded" namespace="urn:uniface:applic:services:CSYV1000" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="urn:uniface:applic:services:CSYV1000" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="LOGON">
<soap:operation soapAction="" />
<wsdl:input>
<soap:body use="encoded" namespace="urn:uniface:applic:services:CSYV1000" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="urn:uniface:applic:services:CSYV1000" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CSYV1000Service">
<wsdl:port name="CSYV1000" binding="tns:CSYV1000Binding">
<soap:address location="http://localhost/pathway/environment.pathway" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Your help is appreciated.
Regards,
Reenal
Hi, Amit.
The problem arises when I send a logon messages from XI, it fails.
The request which works is:
<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:uniface:applic:services:CSYV1000" xmlns:types="urn:uniface:applic:services:CSYV1000/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:LOGON>
<ns0:REQUEST xmlns:ns0="urn:aucklandcity-govt-nz:filenet:property_search"><service>CSYV1000</service><trace/><groupId/><product>SAP XI</product><processId/><threadId/><nodeId/><ipAddress/><sourceUserId/><sourceOSUserId/><uiForm>CMNQ1030</uiForm><groupIdPrevious/><userId>albadryh</userId><password>husain</password><osUserId></osUserId></ns0:REQUEST>
</tns:LOGON>
</soap:Body>
</soap:Envelope>
The problem is that XI is not adding the <tns:LOGON> tags.
Regards,
Reenal
Similar Messages
-
SOAP Receiver adapter target url and method details
Hi Friends,
I am working on file to SOAP interface.
I know using SOAP receiver adapter , we need to have target URL and action.
Here, how client need to give target url and action as they are not aware of these things..please suggest.
Also if we are generating inbound service interface,how they have to handle this from their end.
Thanks
KishoreGet the WSDL file from ur Third party client and u can use the WSDL file as an External definition in PI and WSDL file also has WSDL URL which u can use in SOAP receiver adapter.
For INbound SOAP case-
Generate the WSDL file in XI and give that WSDL file to ur third party client which will send the data using the WSDL URL mentioned in the file.
refer below blog for understanding in detail:-
How to use SOAP adapter:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40611dd6-e66e-2910-f383-e80fb44f9cd4
chirag -
Can I use classes and methods for a maintenance view events?
Hello experts,
Instead of perform/form, can I instead use classes and methods, etc for a given maintenance view event, lets say for example I want to use event '01' which is before saving records in the database. Help would be greatly appreciated. Thanks a lot guys!Hi viraylab,
1. The architecture provided by maintenance view
for using EVENTS and our own code inside it -
It is provided using FORM/PERFORM
concept only.
2. At this stage,we cannot use classes.
3. However, inside the FORM routine,
we can write what ever we want.
We can aswell use any abap code, including
classes and methods.
(But this classes and methods won't have any
effect on the EVENT provided by maintenance view)
regards,
amit m. -
List display for ALV using class and methods
Hi friends
I want the list display for the ALV using Class and methods
which class and methods i can use.
Here we can't use the REUSE_ALV_LIST_DISPLAY and also GRID
I was done GRID display using class and methods but i want only list display for using class.
plz Give me sample code of list display not for grid.
Thanks
Nani.hi
please check with this code...
declare grid and container.
DATA : o_alvgrid TYPE REF TO cl_gui_alv_grid,
o_dockingcontainer TYPE REF TO cl_gui_docking_container,
i_fieldcat TYPE lvc_t_fcat,"fieldcatalogue
w_layout TYPE lvc_s_layo."layout
If any events like double click,etc., are needed we have to add additional functionality.
call the screen in program.
Then , create the container as follows
IF cl_gui_alv_grid=>offline( ) IS INITIAL.
CREATE OBJECT o_dockingcontainer
EXPORTING
ratio = '95'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6.
ENDIF.
CREATE OBJECT o_alvgrid
EXPORTING
i_parent = o_dockingcontainer.
Build the fieldcatalog
create a output structure in SEll for the ALV output
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = <alv output>
CHANGING
ct_fieldcat = i_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE i030."Error in building the field catalogue
LEAVE LIST-PROCESSING.
ENDIF.
*If you need to modify the field catalog,modify it using field sysmbols
*setting the layout
w_layout-grid_title = title.
w_layout-zebra = 'X'.
then displaying the output
CALL METHOD o_alvgrid->set_table_for_first_display
EXPORTING
i_save = 'A'
is_layout = w_layout
CHANGING
it_outtab = i_output[]
it_fieldcatalog = i_fieldcat[]
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE i032 ."Error in Displaying
LEAVE LIST-PROCESSING.
ENDIF.
*After that in PAI of the screen, you need to free the *object while going back from the screen(according to *your requirement)
MODULE user_command_9001 INPUT.
CASE sy-ucomm.
WHEN 'EXIT' OR 'CANC'.
PERFORM f9600_free_objects:
USING o_alvgrid 'ALV' text-e02,
USING o_dockingcontainer 'DOCKING'
text-e01.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_9001 INPUT
*in the program, write the follwoing code
FORM f9600_free_objects USING pobject
value(ptype)
value(ptext).
DATA: l_objectalv TYPE REF TO cl_gui_alv_grid.
CASE ptype.
WHEN 'ALV'.
l_objectalv = pobject.
IF NOT ( l_objectalv IS INITIAL ).
CALL METHOD l_objectalv->free
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
CLEAR: pobject, l_objectalv.
PERFORM f9700_error_handle USING ptext.
ENDIF.
WHEN 'DOCKING'.
DATA: lobjectdock TYPE REF TO cl_gui_docking_container.
lobjectdock = pobject.
IF NOT ( lobjectdock IS INITIAL ).
CALL METHOD lobjectdock->free
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
CLEAR: pobject, lobjectdock.
PERFORM f9700_error_handle USING ptext.
ENDIF.
WHEN 'CONTAINER'.
DATA: lobjectcontainer TYPE REF TO cl_gui_container.
lobjectcontainer = pobject.
IF NOT ( lobjectcontainer IS INITIAL ).
CALL METHOD lobjectcontainer->free
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
CLEAR: pobject, lobjectcontainer.
PERFORM f9700_error_handle USING ptext.
ENDIF.
WHEN OTHERS.
sy-subrc = 1.
PERFORM f9700_error_handle USING
text-e04.
ENDCASE.
ENDFORM. " f9600_free_objects
FORM f9700_error_handle USING value(ptext).
IF sy-subrc NE 0.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = text-e03
txt2 = sy-subrc
txt1 = ptext.
ENDIF.
endform.
also check with this
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
Hope this helps
if it helped, you can acknowledge the same by rewarding
regards
dinesh -
ALV report for 5 Grids using Objects and Method
I have few questions in ALV 5Grids ,could you please correct me in the following program logic...
Using this program logic i am able to generate the five Grids and able to populate Header details from VBAK into Grid1,If you click in the Grid 1 and it is populating item details in Grid2 from VBAP,parallally populating the customer data in Grid5 from KNA1.
Now the pending issue is ,
if you click in the Grid2 then we should populate the shipping details in Grid3 and
if you click in the Grid3 then we should populate the billing details in Grid4.
Program Logic;
REPORT ZAREPAS20.
Tables : vbak,vbap,likp,lips,vbrk,vbrp,kna1.
DATA : OK_CODE LIKE SY-UCOMM,
G_CONTAINER TYPE SCRFNAME VALUE 'BCALV7_GRID_DEMO_0100_VASU',
DOCKING TYPE REF TO CL_GUI_DOCKING_CONTAINER,
SPLITTER_1 TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
SPLITTER_2 TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
splitter_3 TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
CELL_TOP1 TYPE REF TO CL_GUI_CONTAINER,
CELL_BOTTOM1 TYPE REF TO CL_GUI_CONTAINER,
CELL_TOP2 TYPE REF TO CL_GUI_CONTAINER,
CELL_BOTTOM2 TYPE REF TO CL_GUI_CONTAINER,
CELL_LEFT TYPE REF TO CL_GUI_CONTAINER,
CELL_middle TYPE REF TO CL_GUI_CONTAINER,
CELL_RIGHT TYPE REF TO CL_GUI_CONTAINER,
GRID1 TYPE REF TO CL_GUI_ALV_GRID,
GRID2 TYPE REF TO CL_GUI_ALV_GRID,
GRID3 TYPE REF TO CL_GUI_ALV_GRID,
GRID4 TYPE REF TO CL_GUI_ALV_GRID,
GRID5 TYPE REF TO CL_GUI_ALV_GRID.
DATA : GT_VBAK TYPE STANDARD TABLE OF VBAK,
GT_VBAP TYPE STANDARD TABLE OF VBAP,
GT_LIKP TYPE STANDARD TABLE OF likp,
GT_LIPS TYPE STANDARD TABLE OF lips,
GT_VBRK TYPE STANDARD TABLE OF vbrk,
GT_VBRP TYPE STANDARD TABLE OF vbrp,
GT_KNA1 TYPE STANDARD TABLE OF kna1.
DATA:begin of itab1 occurs 0,
vbeln type likp-VBELN,
erzet type likp-ERZET,
lfart type likp-LFART,
posnr type lips-POSNR,
END OF ITAB1.
DATA:begin of itab2 occurs 0,
vbeln like vbrk-vbeln,
posnr like vbrk-fktyp,
fkart like vbrk-fkart,
fklmg like vbrp-fklmg,
end of itab2.
*selection screen for selecting range of values
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE text-001.
select-options: S_vbeln for VBAK-vbeln.
selection-screen end of block b1.
CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING
e_row
e_column
es_row_no
sender. " sending control, i.e. ALV grid that raised event
ENDCLASS. "lcl_eventhandler DEFINITION
CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD HANDLE_DOUBLE_CLICK.
*DEFINE LOCAL DATA.
DATA : itab_vbak type VBAK,
itab_vbap type VBAP,
itab_likp type likp,
itab_lips type lips,
itab_vbrk type vbrk,
itab_vbrp type vbrp,
itab_kna1 type kna1.
*DISTINGUISH ACCORDING TO SENDING GRID INSTANCE
CASE SENDER.
WHEN GRID1.
READ TABLE gt_VBAK INTO itab_vbak INDEX e_row-index.
CHECK ( itab_vbak-vbeln IS NOT INITIAL ).
CALL METHOD GRID1->set_current_cell_via_id
EXPORTING
is_ROW_ID =
is_COLUMN_ID =
is_row_no = es_row_no.
Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'ORDER_DETAILS' ).
WHEN GRID2.
READ TABLE gt_VBAP INTO itab_vbap INDEX e_row-index.
CHECK ( itab_vbap-vbeln IS NOT INITIAL ).
CALL METHOD GRID2->set_current_cell_via_id
EXPORTING
is_ROW_ID =
is_COLUMN_ID =
is_row_no = es_row_no.
Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'ORDER_DETAILS' ).
WHEN GRID3.
READ TABLE gt_LIPS INTO itab_LIPS INDEX e_row-index.
CHECK ( itab_lips-vgbel IS NOT INITIAL ).
CALL METHOD GRID3->set_current_cell_via_id
EXPORTING
is_ROW_ID =
is_COLUMN_ID =
is_row_no = es_row_no.
Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DELIVERY_DETAILS' ).
WHEN GRID4.
READ TABLE gt_VBRP INTO itab_VBRP INDEX e_row-index.
CHECK ( itab_vbrp-vgbel IS NOT INITIAL ).
CALL METHOD GRID4->set_current_cell_via_id
EXPORTING
is_ROW_ID =
is_COLUMN_ID =
is_row_no = es_row_no.
Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'BILLING_DETAILS' ).
WHEN GRID5.
READ TABLE gt_KNA1 INTO itab_KNA1 INDEX e_row-index.
CHECK ( itab_kna1-kunnr IS NOT INITIAL ).
SET PARAMETER ID 'KUN' FIELD itab_KNA1-KUNNR.
CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN.
WHEN OTHERS.
RETURN.
ENDCASE.
endmethod.
endclass. "lcl_eventhandler IMPLEMENTATION
start-of-selection.
*write :/ 'FEDEX INT''''L' .
SELECT * FROM vbak INTO TABLE gt_VBAK
where vbeln IN S_VBELN.
creating docking container
create object docking
exporting
parent = cl_gui_container=>screen0
ratio = 90
exceptions
others = 6.
if sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Create splitter container
CREATE OBJECT splitter_1
EXPORTING
parent = docking
rows = 1
columns = 3
NO_AUTODEF_PROGID_DYNNR =
NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Get cell container
CALL METHOD splitter_1->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = cell_left.
CALL METHOD splitter_1->get_container
EXPORTING
row = 1
column = 2
RECEIVING
container = cell_middle.
CALL METHOD splitter_1->get_container
EXPORTING
row = 1
column = 3
RECEIVING
container = cell_right.
Create 2nd splitter container
CREATE OBJECT splitter_2
EXPORTING
parent = cell_left
rows = 2
columns = 1
NO_AUTODEF_PROGID_DYNNR =
NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Get cell container
CALL METHOD splitter_2->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = cell_top1.
CALL METHOD splitter_2->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = cell_bottom1.
Create 3rd splitter container
CREATE OBJECT splitter_3
EXPORTING
parent = cell_middle
rows = 2
columns = 1
NO_AUTODEF_PROGID_DYNNR =
NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Get cell container
CALL METHOD splitter_3->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = cell_top2.
CALL METHOD splitter_3->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = cell_bottom2.
Create ALV grids
CREATE OBJECT grid1
EXPORTING
i_parent = cell_top1
EXCEPTIONS
OTHERS = 5.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT grid2
EXPORTING
i_parent = cell_bottom1
EXCEPTIONS
OTHERS = 5.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT grid3
EXPORTING
i_parent = cell_top2
EXCEPTIONS
OTHERS = 5.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT grid4
EXPORTING
i_parent = cell_bottom2
EXCEPTIONS
OTHERS = 5.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT grid5
EXPORTING
i_parent = cell_right
EXCEPTIONS
OTHERS = 5.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Set event handler
SET HANDLER: lcl_eventhandler=>handle_double_click FOR grid1.
SET HANDLER: lcl_eventhandler=>handle_double_click FOR grid2.
SET HANDLER: lcl_eventhandler=>handle_double_click FOR grid3.
SET HANDLER: lcl_eventhandler=>handle_double_click FOR grid4.
SET HANDLER: lcl_eventhandler=>handle_double_click FOR grid5.
Display data
CALL METHOD grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'VBAK'
CHANGING
it_outtab = gt_VBAK
EXCEPTIONS
OTHERS = 4.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH: gt_vbap.
CALL METHOD grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'VBAP'
CHANGING
it_outtab = gt_VBAP " empty !!!
EXCEPTIONS
OTHERS = 4.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH: gt_LIPS.
CALL METHOD grid3->set_table_for_first_display
EXPORTING
i_structure_name = 'LIPS'
CHANGING
it_outtab = gt_LIPS " empty !!!
EXCEPTIONS
OTHERS = 4.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH: gt_VBRP.
CALL METHOD grid4->set_table_for_first_display
EXPORTING
i_structure_name = 'VBRP'
CHANGING
it_outtab = gt_VBRP " empty !!!
EXCEPTIONS
OTHERS = 4.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH: gt_KNA1.
CALL METHOD grid5->set_table_for_first_display
EXPORTING
i_structure_name = 'KNA1'
CHANGING
it_outtab = gt_KNA1 " empty !!!
EXCEPTIONS
OTHERS = 4.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Link the docking container to the target dynpro
CALL METHOD docking->link
EXPORTING
repid = syst-repid
dynnr = '0100'
CONTAINER =
EXCEPTIONS
OTHERS = 4.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
NOTE: dynpro does not contain any elements (ok_code -> GD_OKCODE)
CALL SCREEN '0100'.
Flow logic of dynpro:
*PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
*PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
end-of-selection.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'.
SET TITLEBAR 'xxx'.
Refresh display of detail ALV list
CALL METHOD grid2->refresh_table_display
EXPORTING
IS_STABLE =
I_SOFT_REFRESH =
EXCEPTIONS
OTHERS = 2.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Refresh display of detail ALV list
CALL METHOD grid3->refresh_table_display
EXPORTING
IS_STABLE =
I_SOFT_REFRESH =
EXCEPTIONS
OTHERS = 2.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Refresh display of detail ALV list
CALL METHOD grid4->refresh_table_display
EXPORTING
IS_STABLE =
I_SOFT_REFRESH =
EXCEPTIONS
OTHERS = 2.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Refresh display of detail ALV list
CALL METHOD grid5->refresh_table_display
EXPORTING
IS_STABLE =
I_SOFT_REFRESH =
EXCEPTIONS
OTHERS = 2.
IF sy-subrc eq 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK' OR
'EXIT' OR
'CANCEL'.
SET SCREEN 0.LEAVE SCREEN.
USER HAS PUSHED BUTTON "DISPLAY OREDERS"
WHEN 'ORDER_DETAILS'.
PERFORM ORDER_SHOW_DETAILS.
when 'DELIVERY_DETAILS'.
PERFORM DELIVERY_SHOW_DETAILS.
WHEN 'BILLING_DETAILS'.
PERFORM BILLING_SHOW_DETAILS.
WHEN OTHERS.
ENDCASE.
CLEAR : OK_CODE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form ORDER_SHOW_DETAILS
text
--> p1 text
<-- p2 text
FORM order_show_details .
define local data
DATA:
ld_row TYPE i,
itab_VBAK TYPE VBAK.
CALL METHOD grid1->get_current_cell
IMPORTING
e_row = ld_row.
READ TABLE gt_VBAK INTO itab_VBAK INDEX ld_row.
CHECK ( syst-subrc = 0 ).
SELECT * FROM KNA1 INTO TABLE gt_KNA1
WHERE KUNNR = itab_VBAK-KUNNR.
SELECT * FROM VBAP INTO TABLE gt_VBAP
WHERE VBELN = ITAB_VBAK-VBELN.
*REFRESH: gt_LIPS.
ENDFORM. " ORDER_SHOW_DETAILS
*& Form DELIVERY_SHOW_DETAILS
text
--> p1 text
<-- p2 text
FORM DELIVERY_SHOW_DETAILS .
define local data
DATA:
ld_row TYPE i,
itab_VBAP TYPE VBAP.
CALL METHOD grid1->get_current_cell
IMPORTING
e_row = ld_row.
READ TABLE gt_VBAP INTO itab_VBAP INDEX ld_row.
CHECK ( syst-subrc = 0 ).
SELECT LIKPVBELN LIKPERZET LIKPLFART LIPSVBELN
INTO CORRESPONDING FIELDS OF TABLE ITAB1
FROM ( LIKP INNER JOIN LIPS ON LIKPVBELN = LIPSVBELN )
WHERE LIKP~VBELN IN S_VBELN.
*REFRESH: gt_LIPS.
ENDFORM. " DELIVERY_SHOW_DETAILS
*& Form BILLING_SHOW_DETAILS
text
--> p1 text
<-- p2 text
FORM BILLING_SHOW_DETAILS .
define local data
DATA:
ld_row TYPE i,
itab_LIPS TYPE LIPS.
CALL METHOD grid1->get_current_cell
IMPORTING
e_row = ld_row.
READ TABLE gt_LIPS INTO itab_LIPS INDEX ld_row.
CHECK ( syst-subrc = 0 ).
SELECT VBRKVBELN VBRKFKTYP VBRKFKART VBRPFKLMG
INTO CORRESPONDING FIELDS OF TABLE ITAB2
FROM ( VBRK INNER JOIN VBRP ON VBRKVBELN = VBRPVBELN )
WHERE VBRK~VBELN IN S_VBELN.
ENDFORM. " BILLING_SHOW_DETAILSHi,
ALV means ABAP List Viewer. Most convenient way to use it is through reuse library (cf.
transaction se83) available from release 4.6 of SAP R/3.
ALV is available in two modes: list and grid. List mode is good old list processing with
standard functionnalities, and grid mode is using a new OCX object displaying grids.
Classical reports needs more coding to set the horizontal and vertical lines.we need to adjust
the lines manually.Even interactive also takes lot of code.
ALV reports reduces the code when compared to classical reports.we use function modules to
generate the output.
that r REUSE_ALV_LIST_DISPLAY,REUSE_ALV_GRID_DISPLAY,REUSE_ALV_HIERSEQ_LIST_DISPLAY etc..
the following threads will give some examples of the functions which you are expecting
Header
regarding function module
hide ALV field
Simply Display selection parameter values in the ALV OUTPUT
Drag and drop in a report
https://www.sdn.sap
Reprots
http://www.sapgenie.com/abap/reports.htm
http://www.allsaplinks.com/material.html
http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you
use - ABAP Objects calls or simple function modules. -
SOAP Receiver Adapter using SSL - PI 7.0
Hi all,
i am currently faced with a .net WCF webservice integration using https via SOAP Receiver Adapter in PI 7.0.
Can anybody tell me into which Visual Administrator view i have to import my certificate in order to get https working ?
Thanks in advance,
MartinIt must be the View you have created for your partners. There is usually a Trusted view where you have your own certificate. And there are other views where partners cerificates are stored. There you have to store the certificate.
Regards,
Prateek -
Problem in testing SOAP receiver adapter using SOAP UI
Dear Experts,
I'm trying to test my SOAP receiver adapter as mentioned in the blog http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/21844. [original link is broken] [original link is broken] [original link is broken] But, my request from ECC proxy keeps failing in XI communcation channel monitor. I've configured my receiver adapter http://ip:8080/mockSoapHTTPBinding and kept the authentication as NONE. Can any of you suggest?
ip - is my system ip shown in ipconfig.
mockSoapHTTPBinding - is the path.
Thanks.What is the error of the messages? Are the messages leaving the SOAP adapter?
Please try both:
1. Go to Runtime Workbench -> Component Monitoring -> Adapter Engine -> Test message. Then, execute the message directly without the intermediate of the Proxy sender. This will allow you to check only the receiver SOAP.
2. Please use the TCPGateway tool attached from the note below. It will be a "man-in-the-middle" between the target WS and the Receiver SOAP channel, tracking the whole HTTP/SOAP message. Check if the message is well-formed.
[Note 856597 - FAQ: XI 3.0 / PI 7.0 / PI 7.1 SOAP Adapter|https://websmp230.sap-ag.de/sap(bD1wdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=856597]
under question "Q: How can I trace the whole message?" -
Hi Experts,
I am studying ABAP Objects, before that I need to know How to use the exsiting classes and Methods in our program and how to search for particular class and methods?
If it explanied with example well and good.
Thanks
saiHi Saikar,
Here i am sending you very useful content for the usage of classes and its methods.
It helped me a lot.
If you find it useful then do not forget to award points.
Table of Contents
Applies to:......................................................................................................................................1
Summary........................................................................................................................................1
Author Bio......................................................................................................................................1
Main Class CL_SALV_TABLE......................................................................................................3
Functions CL_SALV_FUNCTIONS..............................................................................................4
Display Settings CL_SALV_DISPLAY_SETTINGS......................................................................4
Columns CL_SALV_COLUMNS_TABLE and CL_SALV_COLUMN_TABLE..............................5
Sorts CL_SALV_SORTS..............................................................................................................8
Aggregations CL_SALV_AGGREGATIONS..............................................................................10
Filters CL_SALV_FILTERS........................................................................................................12
Layouts CL_SALV_LAYOUT......................................................................................................14
Related Content...........................................................................................................................15
Disclaimer and Liability Notice.......................................................................................................16
ALV Object Model Simple 2D Table - The Basics SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 3
Main Class CL_SALV_TABLE
The main class used to create the simple 2D table is the class CL_SALV_TABLE. Create a reference variable for this class. Create an internal table and fill this internal table with data as show below.
REPORT ZALVOM_DEMO1. data: ispfli type table of spfli. data: gr_table type ref to cl_salv_table. start-of-selection. select * into table ispfli from spfli.
Next we need to create the ALV object for the 2D table. The FACTORY method allows you to create the ALV object in 3 ways. You can create the ALV Grid, as a classical list display, as a full screen grid, and finally embedded into a screen container. For this example, we will be working with the full screen grid. Create the call to the FACTORY method. We are importing the object reference into GR_TABLE and passing the internal table ISPFLI.
cl_salv_table=>factory( importing r_salv_table = gr_table changing t_table = ispfli ).
Next we need to display the grid, for this we use the DISPLAY method . Simply call it.
gr_table->display( ).
ALV Object Model Simple 2D Table - The Basics SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 4
Functions CL_SALV_FUNCTIONS
Next, add functions to the application toolbar. For this, use the CL_SALV_FUNCTIONS class. Create the object reference variable and receive the object using the GET_FUNCTIONS method of the GR_TABLE object. Call the method SET_ALL to force the ALV grid to show all standard functions.
report zalvom_demo1. data: ispfli type table of spfli. data: gr_table type ref to cl_salv_table. data: gr_functions type ref to cl_salv_functions. start-of-selection. select * into table ispfli from spfli. cl_salv_table=>factory( importing r_salv_table = gr_table changing t_table = ispfli ). gr_functions = gr_table->get_functions( ). gr_functions->set_all( abap_true ). gr_table->display( ).
The result is now you have the standard buttons on the application toolbar.
Display Settings CL_SALV_DISPLAY_SETTINGS
Next, we can change some display settings using the class CL_SALV_DISPLAY_SETTINGS. Create the object reference variable and receive the object using the GET_DISPLAY_SETTINGS method of the GR_TABLE object. In this example, we are setting the Striped Pattern for the ALV Grid rows, and setting the heading in the title bar.
report zalvom_demo1.
ALV Object Model Simple 2D Table - The Basics SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 5
). data: ispfli type table of spfli. data: gr_table type ref to cl_salv_table. data: gr_functions type ref to cl_salv_functions. data: gr_display type ref to cl_salv_display_settings. start-of-selection. select * into table ispfli from spfli. cl_salv_table=>factory( importing r_salv_table = gr_table changing t_table = ispfli ). gr_functions = gr_table->get_functions( ). gr_functions->set_all( abap_true ). gr_display = gr_table->get_display_settings( ). gr_display->set_striped_pattern( cl_salv_display_settings=>true ). gr_display->set_list_header( 'This is the heading' gr_table->display( ).
Columns CL_SALV_COLUMNS_TABLE and CL_SALV_COLUMN_TABLE
Next, we can change some of the attributes of a specific column in the ALV grid. In this example we will change the Heading Text of a column as well as the color of a column. Create the object reference variable and receive the object using the GET_COLUMNS method of the GR_TABLE object. This will pass you the object for all columns of the ALV grid. To access just one column, call the method GET_COLUMN from the GR_COLUMNS object. In this example, we are accessing the CITYTO column and the CITYFROM column.
report zalvom_demo1. data: ispfli type table of spfli. data: gr_table type ref to cl_salv_table. data: gr_functions type ref to cl_salv_functions.
ALV Object Model Simple 2D Table - The Basics SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 6
data: gr_display type ref to cl_salv_display_settings. data: gr_columns type ref to cl_salv_columns_table. data: gr_column type ref to cl_salv_column_table.
data: color type lvc_s_colo.
start-of-selection. select * into table ispfli from spfli. cl_salv_table=>factory( importing r_salv_table = gr_table changing t_table = ispfli ). gr_functions = gr_table->get_functions( ). gr_functions->set_all( abap_true ). gr_display = gr_table->get_display_settings( ). gr_display->set_striped_pattern( cl_salv_display_settings=>true ). gr_display->set_list_header( 'This is the heading' ). gr_columns = gr_table->get_columns( ). gr_column ?= gr_columns->get_column( 'CITYTO' ). gr_column->set_long_text( 'This is long text' ). gr_column->set_medium_text( 'This is med text' ).
gr_column->set_short_text( 'This is sh' ).
gr_column ?= gr_columns->get_column( 'CITYFROM' ). color-col = '6'. color-int = '1'. color-inv = '0'. gr_column->set_color( color ).
gr_table->display( ).
ALV Object Model Simple 2D Table - The Basics SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 7 ALV Object Model Simple 2D Table - The Basics SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 8
Sorts CL_SALV_SORTS
Next, we can add some sorting to the ALV grid. Create the object reference variable and receive the object using the GET_SORTS method of the GR_TABLE object. Next, add the sort by calling the ADD_SORT method of the GR_SORTS object.
report zalvom_demo1. data: ispfli type table of spfli. data: gr_table type ref to cl_salv_table. data: gr_functions type ref to cl_salv_functions. data: gr_display type ref to cl_salv_display_settings. data: gr_columns type ref to cl_salv_columns_table. data: gr_column type ref to cl_salv_column_table. data: gr_sorts type ref to cl_salv_sorts.
data: color type lvc_s_colo.
start-of-selection. select * into table ispfli from spfli. cl_salv_table=>factory( importing r_salv_table = gr_table changing t_table = ispfli ). gr_functions = gr_table->get_functions( ). gr_functions->set_all( abap_true ). gr_display = gr_table->get_display_settings( ). gr_display->set_striped_pattern( cl_salv_display_settings=>true ). gr_display->set_list_header( 'This is the heading' ). gr_columns = gr_table->get_columns( ). gr_column ?= gr_columns->get_column( 'CITYTO' ). gr_column->set_long_text( 'This is long text' ). gr_column->set_medium_text( 'This is med text' ). gr_column->set_short_text( 'This is sh' ). gr_column ?= gr_columns->get_column( 'CITYFROM' ). color-col = '6'. color-int = '1'. color-inv = '0'. gr_column->set_color( color ). gr_sorts = gr_table->get_sorts( ). gr_sorts->add_sort 'CITYTO' ). gr_table->display( ).
ALV Object Model Simple 2D Table - The Basics SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 9 ALV Object Model Simple 2D Table - The Basics SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 10
Aggregations CL_SALV_AGGREGATIONS
Since we sorted by CITYTO, we can add an aggregation to subtotal the DISTANCE by CITYTO. Create the object reference variable and receive the object using the GET_AGGREGATIONS method of the GR_TABLE object. Next, add the aggregation by calling the ADD_AGGREGATION method of the GR_SORTS object. We also need to modify the call to ADD_SORT to set the SUBTOTAL = ABAP_TRUE.
report zalvom_demo1. data: ispfli type table of spfli. data: gr_table type ref to cl_salv_table. data: gr_functions type ref to cl_salv_functions. data: gr_display type ref to cl_salv_display_settings. data: gr_columns type ref to cl_salv_columns_table. data: gr_column type ref to cl_salv_column_table. data: gr_sorts type ref to cl_salv_sorts. data: gr_agg type ref to cl_salv_aggregations.
data: color type lvc_s_colo.
start-of-selection. select * into table ispfli from spfli. cl_salv_table=>factory( importing r_salv_table = gr_table changing t_table = ispfli ). gr_functions = gr_table->get_functions( ). gr_functions->set_all( abap_true ). gr_display = gr_table->get_display_settings( ). gr_display->set_striped_pattern( cl_salv_display_settings=>true ). gr_display->set_list_header( 'This is the heading' ). gr_columns = gr_table->get_columns( ). gr_column ?= gr_columns->get_column( 'CITYTO' ). gr_column->set_long_text( 'This is long text' ). gr_column->set_medium_text( 'This is med text' ). gr_column->set_short_text( 'This is sh' ). gr_column ?= gr_columns->get_column( 'CITYFROM' ). color-col = '6'. color-int = '1'. color-inv = '0'. gr_column->set_color( color ). gr_sorts = gr_table->get_sorts( ). gr_sorts->add_sort( columnname = 'CITYTO' subtotal = abap_true ). gr_agg = gr_table->get_aggregations( ). gr_agg->add_aggregation( 'DISTANCE' ).
ALV Object Model Simple 2D Table - The Basics SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 11
gr_table->display( ).
ALV Object Model Simple 2D Table - The Basics SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 12
Filters CL_SALV_FILTERS
Using the CL_SALV_FILTERS class we can setup some filters for the data in our ALV GRID. Create the object reference variable and receive the object using the GET_FILTERS method of the GR_TABLE object, and then simply called the method ADD_FILTER with the parameters.
report zalvom_demo1. data: ispfli type table of spfli. data: gr_table type ref to cl_salv_table. data: gr_functions type ref to cl_salv_functions. data: gr_display type ref to cl_salv_display_settings. data: gr_columns type ref to cl_salv_columns_table. data: gr_column type ref to cl_salv_column_table. data: gr_sorts type ref to cl_salv_sorts. data: gr_agg type ref to cl_salv_aggregations. data: gr_filter type ref to cl_salv_filters.
data: color type lvc_s_colo.
start-of-selection. select * into table ispfli from spfli. cl_salv_table=>factory( importing r_salv_table = gr_table changing t_table = ispfli ). gr_functions = gr_table->get_functions( ). gr_functions->set_all( abap_true ). gr_display = gr_table->get_display_settings( ). gr_display->set_striped_pattern( cl_salv_display_settings=>true ). gr_display->set_list_header( 'This is the heading' ). gr_columns = gr_table->get_columns( ). gr_column ?= gr_columns->get_column( 'CITYTO' ). gr_column->set_long_text( 'This is long text' ). gr_column->set_medium_text( 'This is med text' ). gr_column->set_short_text( 'This is sh' ). gr_column ?= gr_columns->get_column( 'CITYFROM' ). color-col = '6'. color-int = '1'. color-inv = '0'. gr_column->set_color( color ). gr_sorts = gr_table->get_sorts( ). gr_sorts->add_sort( columnname = 'CITYTO' subtotal = abap_true ). gr_agg = gr_table->get_aggregations( ). gr_agg->add_aggregation( 'DISTANCE' ).
ALV Object Model Simple 2D Table - The Basics SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 13
gr_filter = gr_table->get_filters( ). gr_filter->add_filter( columnname = 'CARRID' low = 'LH' ). gr_table->display( ).
ALV Object Model Simple 2D Table - The Basics SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 14
Layouts CL_SALV_LAYOUT
If you want to allow the user to manage layouts of the ALV grid, you must use the class CL_SALV_LAYOUT. Create the object reference variable and receive the object using the GET_LAYOUT method of the GR_TABLE object. Then simply call the method SET_KEY with the parameters and set the save restriction using the SET_SAVE_RESTRICTION method.
report zalvom_demo1. data: ispfli type table of spfli. data: gr_table type ref to cl_salv_table. data: gr_functions type ref to cl_salv_functions. data: gr_display type ref to cl_salv_display_settings. data: gr_columns type ref to cl_salv_columns_table. data: gr_column type ref to cl_salv_column_table. data: gr_sorts type ref to cl_salv_sorts. data: gr_agg type ref to cl_salv_aggregations. data: gr_filter type ref to cl_salv_filters. data: gr_layout type ref to cl_salv_layout. data: color type lvc_s_colo. data: key type salv_s_layout_key. start-of-selection. select * into table ispfli from spfli. cl_salv_table=>factory( importing r_salv_table = gr_table changing t_table = ispfli ). gr_functions = gr_table->get_functions( ). gr_functions->set_all( abap_true ). gr_display = gr_table->get_display_settings( ). gr_display->set_striped_pattern( cl_salv_display_settings=>true ). gr_display->set_list_header( 'This is the heading' ). gr_columns = gr_table->get_columns( ). gr_column ?= gr_columns->get_column( 'CITYTO' ). gr_column->set_long_text( 'This is long text' ). gr_column->set_medium_text( 'This is med text' ). gr_column->set_short_text( 'This is sh' ). gr_column ?= gr_columns->get_column( 'CITYFROM' ). color-col = '6'. color-int = '1'. color-inv = '0'. gr_column->set_color( color ). gr_sorts = gr_table->get_sorts( ). gr_sorts->add_sort( columnname = 'CITYTO' subtotal = abap_true ). gr_agg = gr_table->get_aggregations( ).
ALV Object Model Simple 2D Table - The Basics SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 15
gr_filter = gr_table->get_filters( ). gr_layout = gr_table->get_layout( ). gr_layout->set_key( ). gr_table->display( ). gr_agg->add_aggregation( 'DISTANCE' ). gr_filter->add_filter( columnname = 'CARRID' low = 'LH' ). key-report = sy-repid. key gr_layout->set_save_restriction( cl_salv_layout=>restrict_none ).
Related Content
Help - ALV Object Model
Utilizing the New ALV Object Model
SDN ABAP Forum
ALV Object Model Simple 2D Table - The Basics SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2006 SAP AG 16
Disclaimer and Liability Notice
This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.
SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk.
SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.
Regards,
Mandeep.
Note: Award points if contents are useful. -
Hi all
how can i use alv 's for reading data from table mara and dispyaing 10 records on out put screen as a grid using classes or methods
thanks in advanceHi,
look into the sample code:
TYPE-POOLS *
TYPE-POOLS: slis.
TRANSPARENT TABLES *
TABLES: rbkp,rbco,sscrfields,t009b.
CLASS cl_event_receiver DEFINITION
CLASS cl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS: handle_double_click
FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING e_row e_column,
handle_top_of_page
FOR EVENT print_top_of_page OF cl_gui_alv_grid.
PRIVATE SECTION.
ENDCLASS.
CLASS CL_EVENT_RECEIVER IMPLEMENTATION
CLASS cl_event_receiver IMPLEMENTATION.
*--Method double click
METHOD :handle_double_click.
PERFORM drill_down USING e_column-fieldname
e_row-index .
ENDMETHOD.
*--Method top of page
METHOD handle_top_of_page.
PERFORM event_top_of_page.
ENDMETHOD. "top_of_page
ENDCLASS.
DATA: event_receiver TYPE REF TO cl_event_receiver.
Global Variables *
DATA:
v_xblnr LIKE rbkp-xblnr, " Refernce Doc No
v_lifnr LIKE lfa1-lifnr, " Vendor
v_bukrs LIKE t001-bukrs, " Company Code
v_zzmprd LIKE mara-matnr, " MPM
v_monat LIKE t009b-poper. " Fiscal Period
GLOBAL TYPES *
*-Structure for Invoice details
TYPES:BEGIN OF y_invoice,
belnr LIKE rbkp-belnr, " Invoice Doc No
gjahr LIKE rbkp-gjahr, " Fiscal Year
blart LIKE rbkp-blart, " Document type
bldat LIKE rbkp-bldat, " Document date
budat LIKE rbkp-budat, " Posting date
xblnr LIKE rbkp-xblnr, " Refernce Doc no
bukrs LIKE rbkp-bukrs, " Company Code
lifnr LIKE rbkp-lifnr, " Vendor
waers LIKE rbkp-waers, " Local Currency
bktxt LIKE rbkp-bktxt, " Doc header text
zlspr LIKE rbkp-zlspr, " payment block
buzei LIKE rseg-buzei, " Invoice Item No
ebeln LIKE rseg-ebeln, " PO
ebelp LIKE rseg-ebelp, " PO line item
matnr LIKE rseg-matnr, " SAP Material
bwtar LIKE rseg-bwtar, " Valuation type
wrbtr LIKE rseg-wrbtr, " Inv Value
menge LIKE rseg-menge, " Inv Qty
END OF y_invoice,
*-Structure for Material details
BEGIN OF y_material,
matnr LIKE mara-matnr, " Material No
normt LIKE mara-normt, " Article Number
ismconttype LIKE mara-ismconttype, " Window
ismdesign LIKE mara-ismdesign, " No of disc in MPM
werks LIKE marc-werks, " Plant
mfrgr LIKE marc-mfrgr, " Product Line
END OF y_material,
Structure for Costtype data
BEGIN OF y_costtype,
bukrs LIKE zsn0325_costtype-bukrs, " Company Code
land1 LIKE zsn0325_costtype-land1, " Country key
window LIKE zsn0325_costtype-window, " Window
ewlnr LIKE zsn0325_costtype-ewlnr, " Cost type
distmeth LIKE zsn0325_costtype-distmeth, " Distribution type
zvalfrom LIKE zsn0325_costtype-zvalfrom, " Posting date from
zvalto LIKE zsn0325_costtype-zvalto, " Posting Date TO
disc1pr LIKE zsn0325_costtype-disc1pr, " Disc price
disc2pr LIKE zsn0325_costtype-disc2pr, " Disc price
END OF y_costtype,
Structure for Distmeth data
BEGIN OF y_distmeth,
distmeth LIKE zsn0325_distmeth-distmeth, " Distribution Methods
distext LIKE zsn0325_distmeth-distext, " Description
END OF y_distmeth,
*-structure for rbco
BEGIN OF y_rbco,
belnr LIKE rbco-belnr, " Account Doc#
gjahr LIKE rbco-gjahr, " Fiscal year
buzei LIKE rbco-buzei, " Doc item in inv doc
cobl_nr LIKE rbco-cobl_nr, " 4 Character
" Seq No for Coding
wrbtr LIKE rbco-wrbtr, " Amt in doc currency
saknr LIKE rbco-saknr, " G/L Account Number
sgtxt LIKE rbco-sgtxt, " Item text
zzcou LIKE rbco-zzcou, " Country
zzmprd LIKE rbco-zzmprd, " MPM Product
menge LIKE rbco-menge, " Quantity
bukrs LIKE rbco-bukrs, " Company Code
xnegp LIKE rbco-xnegp, " Variance Flag
matnr LIKE mara-matnr, " MPM Product
land1 LIKE zsop_fame-sop_cnt, " SOP country code
END OF y_rbco,
*-structure for rbco_tmp
BEGIN OF y_rbco_tmp,
bukrs LIKE rbco-bukrs, " Company Code
sgtxt LIKE rbco-sgtxt, " Item text
ewlnr LIKE zsn0325_costtype-ewlnr, " Cost type
distmeth LIKE zsn0325_costtype-distmeth, " Distribution type
land1 LIKE zsop_fame-sop_cnt, " SOP country code
END OF y_rbco_tmp,
*-Structure for setleaf
BEGIN OF y_setleaf,
setname LIKE setleaf-setname,
valsign LIKE setleaf-valsign,
valoption LIKE setleaf-valoption,
valfrom LIKE setleaf-valfrom,
valto LIKE setleaf-valto,
END OF y_setleaf,
*-Structure for Output data
BEGIN OF y_output,
bukrs LIKE rbkp-bukrs, " Company Code
gjahr LIKE rbkp-gjahr, " Fiscal year
lifnr LIKE rbkp-lifnr, " Vendor
zlspr LIKE rbkp-zlspr, " Payment block
xblnr LIKE rbkp-xblnr, " Refernece Doc no
bldat LIKE rbkp-bldat, " Document date
budat LIKE rbkp-budat, " Posting date
belnr LIKE rbkp-belnr, " Invoice Doc No
bktxt LIKE rbkp-bktxt, " Invoice Type
normt LIKE mara-normt, " Article Number
ismconttype LIKE mara-ismconttype, " Window
zzcou LIKE rbco-zzcou, " Country
zzmprd LIKE rbco-zzmprd, " MPM Product
xnegp LIKE rbco-xnegp, " Cost type variance
cobl_nr LIKE rbco-cobl_nr, " 4 Character
" Seq No for Coding
invfqty LIKE rbco-menge, " Inventory Fee Qty
discqty LIKE rbco-menge, " Dist Cost Qty
disrqty LIKE rbco-menge, " Dist Return Qty
sseqty LIKE rbco-menge, " Special Services Qty
sgtxt LIKE rbco-sgtxt, " Item Text
ismdesign LIKE mara-ismdesign, " No of disc on MPM
mfrgr LIKE marc-mfrgr, " Product Line
ddeal(3), " Distribution DEAL
distmeth LIKE zsn0325_costtype-distmeth, " Distribution type
distext LIKE zsn0325_distmeth-distext, " Description
ndisc(2) TYPE c, " NO of disc on INV
rifval LIKE rbco-wrbtr, " Inv fee value
stdrif LIKE zsn0325_costtype-disc1pr, " STD Inv fee
rfvar LIKE zsn0325_costtype-disc1pr, " Inv Fee Variance
dicval LIKE rbco-wrbtr, " Dist cost Value
stddico LIKE zsn0325_costtype-disc1pr, " STD Dis cost
dicvar LIKE zsn0325_costtype-disc1pr, " Dist Cost Variance
disrev LIKE rbco-wrbtr, " Dist Return Value
stdirco LIKE zsn0325_costtype-disc1pr, " STD Dis Return cost
drevar LIKE zsn0325_costtype-disc1pr, " Dist Ret Variance
adj_qty_ct LIKE rbco-menge, " Adjustments Qty
adj_pr_ct LIKE rbco-wrbtr, " Adjustments Value
ssval LIKE rbco-wrbtr, " Special Value
color_cell TYPE lvc_t_scol, " Cell Color
END OF y_output,
*-Structure for Temporary Output data
BEGIN OF y_output_tmp,
bukrs LIKE rbkp-bukrs, " Company Code
gjahr LIKE rbkp-gjahr, " Fiscal year
lifnr LIKE rbkp-lifnr, " Vendor
zlspr LIKE rbkp-zlspr, " Payment block
xblnr LIKE rbkp-xblnr, " Refernece Doc no
bldat(10) TYPE c, " Document Date
budat(10) TYPE c, " Posting date
belnr LIKE rbkp-belnr, " Invoice Doc No
bktxt LIKE rbkp-bktxt, " Invoice Type
normt(18) TYPE c, " Article Number
ismconttype LIKE mara-ismconttype, " Window
zzcou LIKE rbco-zzcou, " Country
zzmprd LIKE rbco-zzmprd, " MPM Product
xnegp LIKE rbco-xnegp, " Cost type variance
cobl_nr LIKE rbco-cobl_nr, " 4 Character
" Seq No for Coding
invfqty LIKE rbco-menge, " Inventory Fee Qty
discqty LIKE rbco-menge, " Dist Cost Qty
disrqty LIKE rbco-menge, " Dist Return Qty
sseqty LIKE rbco-menge, " Special Services Qty
sgtxt LIKE rbco-sgtxt, " Item Text
ismdesign(2) TYPE c, " No of disc on MPM
mfrgr LIKE marc-mfrgr, " Product Line
ddeal(3), " Distribution DEAL
distmeth LIKE zsn0325_costtype-distmeth, " Distribution type
distext LIKE zsn0325_distmeth-distext, " Description
ndisc(2) TYPE c, " NO of disc on INV
rifval LIKE rbco-wrbtr, " Inv fee value
stdrif LIKE zsn0325_costtype-disc1pr, " STD Inv fee
rfvar LIKE zsn0325_costtype-disc1pr, " Inv Fee Variance
dicval LIKE rbco-wrbtr, " Dist cost Value
stddico LIKE zsn0325_costtype-disc1pr, " STD Dis cost
dicvar LIKE zsn0325_costtype-disc1pr, " Dist Cost Variance
disrev LIKE rbco-wrbtr, " Dist Return Value
stdirco LIKE zsn0325_costtype-disc1pr, " STD Dis Return cost
drevar LIKE zsn0325_costtype-disc1pr, " Dist Ret Variance
adj_qty_ct LIKE rbco-menge, " Adjustments Qty
adj_pr_ct LIKE rbco-wrbtr, " Adjustments Value
ssval LIKE rbco-wrbtr, " Special Value
color_cell TYPE lvc_t_scol, " Cell Color
END OF y_output_tmp.
GLOBAL DATA -INTERNAL TABLES *
DATA: i_invoice TYPE STANDARD TABLE OF y_invoice,
i_output TYPE STANDARD TABLE OF y_output,
i_output_tmp TYPE STANDARD TABLE OF y_output_tmp,
i_rbco TYPE STANDARD TABLE OF y_rbco,
i_rbco_tmp TYPE STANDARD TABLE OF y_rbco_tmp,
i_setleaf TYPE STANDARD TABLE OF y_setleaf,
i_material TYPE STANDARD TABLE OF y_material,
i_costtype TYPE STANDARD TABLE OF y_costtype,
i_distmeth TYPE STANDARD TABLE OF y_distmeth,
i_toolbar_excluding TYPE ui_functions,
i_fieldcatalog TYPE lvc_t_fcat.
WORK AREAS *
DATA: w_invoice TYPE y_invoice,
w_material TYPE y_material,
w_output TYPE y_output,
w_output_tmp TYPE y_output_tmp,
w_costtype TYPE y_costtype,
w_distmeth TYPE y_distmeth,
w_rbco TYPE y_rbco,
w_rbco_tmp TYPE y_rbco_tmp,
w_setleaf TYPE y_setleaf,
w_toolbar_excluding TYPE ui_func,
w_fieldcatalog TYPE lvc_s_fcat.
*--Ranges
RANGES: r_setinv FOR setleaf-valfrom,
r_matnr FOR mara-matnr.
DATA DECLARATION FOR ALV *
*--Data declaration for ALV Grid
DATA :w_alvgrid TYPE REF TO cl_gui_alv_grid,
w_ccontainer TYPE REF TO cl_gui_custom_container,
w_okcode LIKE sy-ucomm.
*--Color cell
DATA: i_color TYPE lvc_t_scol,
w_color TYPE lvc_s_scol.
*--- Layout structure
DATA w_layout TYPE lvc_s_layo .
SELECTION SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-055.
SELECT-OPTIONS:
s_bukrs FOR rbkp-bukrs, " Company Code
s_lifnr FOR rbkp-lifnr, " Vendor
s_xblnr FOR rbkp-xblnr, " Reference Doc No
s_gjahr FOR rbkp-gjahr OBLIGATORY, " Fiscal Year
s_monat FOR t009b-poper, " Period
s_budat FOR rbkp-budat, " Posting date
s_bldat FOR rbkp-bldat, " Document date
s_zzmprd FOR rbco-zzmprd. " MPM
SELECTION-SCREEN END OF BLOCK blk1.
AT SELECTION SCREEN *
Validating Company Code
AT SELECTION-SCREEN ON s_bukrs.
IF NOT s_bukrs[] IS INITIAL.
SELECT bukrs " Company Code
UP TO 1 ROWS
INTO v_bukrs
FROM t001
WHERE bukrs IN s_bukrs.
ENDSELECT.
IF sy-subrc NE 0.
MESSAGE e000 WITH 'Invalid Company Code'(e06).
ENDIF.
ENDIF.
Validating ODS Invoice Document No.
AT SELECTION-SCREEN ON s_xblnr.
IF NOT s_xblnr[] IS INITIAL.
SELECT xblnr " Reference Document number
UP TO 1 ROWS
INTO v_xblnr
FROM rbkp
WHERE xblnr IN s_xblnr.
ENDSELECT.
IF sy-subrc NE 0.
MESSAGE e000 WITH 'Invalid ODS Invoice No.'(e05).
ENDIF.
ENDIF.
Validating Vendor Number
AT SELECTION-SCREEN ON s_lifnr.
IF NOT s_lifnr[] IS INITIAL.
SELECT lifnr " Vendor Number
UP TO 1 ROWS
INTO v_lifnr
FROM lfa1
WHERE lifnr IN s_lifnr.
ENDSELECT.
IF sy-subrc NE 0.
MESSAGE e000 WITH 'Invalid Vendor Number'(e04).
ENDIF.
ENDIF.
Validating MPM
AT SELECTION-SCREEN ON s_zzmprd.
REFRESH r_matnr.
LOOP AT s_zzmprd.
MOVE-CORRESPONDING s_zzmprd TO r_matnr.
IF NOT s_zzmprd IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = s_zzmprd-low
IMPORTING
output = r_matnr-low
EXCEPTIONS
length_error = 1
OTHERS = 2.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = s_zzmprd-high
IMPORTING
output = r_matnr-high
EXCEPTIONS
length_error = 1
OTHERS = 2.
APPEND r_matnr.
ENDIF.
ENDLOOP.
SELECT matnr " MPM
UP TO 1 ROWS
INTO v_zzmprd
FROM mara
WHERE matnr IN r_matnr.
ENDSELECT.
IF sy-subrc NE 0.
MESSAGE e000 WITH 'Invalid MPM'(e09).
ENDIF.
Validating Fiscal Period
IF NOT s_monat[] IS INITIAL.
SELECT poper " Fiscal Period
UP TO 1 ROWS
INTO v_monat
FROM t009b
WHERE periv = 'K4'
AND poper IN s_monat
AND bdatj IN s_gjahr.
ENDSELECT.
IF sy-subrc NE 0.
MESSAGE e000 WITH 'Invalid Fiscal Period'(e02).
ENDIF.
ENDIF.
*For Company Code & Vendor
AT SELECTION-SCREEN.
MOVE sy-ucomm TO sscrfields-ucomm.
IF sy-ucomm EQ 'ONLI'
AND s_bukrs[] IS INITIAL
AND s_lifnr[] IS INITIAL.
MESSAGE i000 WITH
'Either Company code or Vendor must be selected'(e03).
STOP.
ENDIF.
IF ( NOT s_budat[] IS INITIAL OR NOT s_bldat IS INITIAL )
AND NOT s_monat[] IS INITIAL.
MESSAGE i000 WITH
'Select either Period or Posting date,Document date'(e01).
STOP.
ENDIF.
START OF SELECTION *
START-OF-SELECTION.
*-Retrieve Invoice Details from RBKP & RSEG
PERFORM get_invoice.
IF NOT i_invoice[] IS INITIAL.
*-Retrieve Invoice Details from RBCO
PERFORM get_rbco.
ENDIF.
IF NOT i_rbco[] IS INITIAL.
*-Retrieve Material Document details from MARA & MARC
PERFORM get_material.
ENDIF.
IF NOT i_invoice[] IS INITIAL.
*-Retrieve costtype details from zsn0325_costtype & zsn0325_distmeth
PERFORM get_costtype.
PERFORM get_distmeth.
ENDIF.
*-Populate internal table for output
PERFORM populate_output.
END OF SELECTION *
END-OF-SELECTION.
*-TO Display Output
IF NOT i_invoice[] IS INITIAL
AND NOT i_output[] IS INITIAL.
PERFORM display_report.
CALL SCREEN 100.
ENDIF.
*& Form get_Invoice
Retrieve Invoice Details from RBKP & RSEG
FORM get_invoice.
DATA : lv_monat LIKE bkpf-monat.
*-Get Value form set zsn_doc_types_inv
SELECT setname
valsign
valoption
valfrom
valto
FROM setleaf
INTO TABLE i_setleaf
WHERE setclass = '0000'
AND setname = 'ZSN_DOC_TYPES_INV'.
IF sy-subrc = 0.
LOOP AT i_setleaf INTO w_setleaf.
r_setinv-sign = w_setleaf-valsign.
r_setinv-option = w_setleaf-valoption.
r_setinv-low = w_setleaf-valfrom.
r_setinv-high = w_setleaf-valto.
APPEND r_setinv.
ENDLOOP.
ENDIF.
Get Invoice Doc details
SELECT a~belnr " Document number of an invoice
a~gjahr " Fiscal Year
a~blart " Document type
a~bldat " Document Date in Document
a~budat " Posting Date in the Document
a~xblnr " Reference Document Number
a~bukrs " Company Code
a~lifnr " Different invoicing party
a~waers " Currency Key
a~bktxt " Document header text
a~zlspr " Payment Block Key
b~buzei " Document item in invoice
b~ebeln " Purchasing Document Number
b~ebelp " Item Number of PO Document
b~matnr " Material Number
b~bwtar " Valuation type
b~wrbtr " Amount in document currency
b~menge " Quantity
INTO TABLE i_invoice
FROM rbkp AS a
LEFT OUTER JOIN rseg AS b
ON abelnr EQ bbelnr
WHERE a~bukrs IN s_bukrs
AND a~gjahr IN s_gjahr
AND a~bldat IN s_bldat
AND a~blart IN r_setinv
AND a~budat IN s_budat
AND a~xblnr IN s_xblnr
AND a~lifnr IN s_lifnr.
IF sy-subrc NE 0.
MESSAGE i000 WITH 'No Invoice exists for this selection'(e07)
'criteria'(e08).
STOP.
ELSE.
SORT i_invoice BY belnr gjahr.
LOOP AT i_invoice INTO w_invoice.
CALL FUNCTION 'FI_PERIOD_DETERMINE'
EXPORTING
i_budat = w_invoice-budat
i_bukrs = w_invoice-bukrs
i_periv = 'K4'
i_gjahr = w_invoice-gjahr
I_MONAT = 00
X_XMO16 = ' '
IMPORTING
E_GJAHR =
e_monat = lv_monat
E_POPER =
EXCEPTIONS
fiscal_year = 1
period = 2
period_version = 3
posting_period = 4
special_period = 5
version = 6
posting_date = 7
OTHERS = 8.
IF sy-subrc <> 0.
DELETE i_invoice.
ELSE.
IF lv_monat IN s_monat.
ELSE.
DELETE i_invoice.
ENDIF.
ENDIF.
ENDLOOP.
IF i_invoice[] IS INITIAL.
MESSAGE i000 WITH 'No Invoice exists for this selection'(e07)
'criteria'(e08).
STOP.
ENDIF.
ENDIF.
ENDFORM. " get_Invoice
*& Form get_rbco
Retrieve Invoice Details from RBCO
FORM get_rbco.
SELECT belnr
gjahr
buzei
cobl_nr
wrbtr
saknr
sgtxt
zzcou
zzmprd
menge
bukrs
xnegp
FROM rbco
INTO TABLE i_rbco
FOR ALL ENTRIES IN i_invoice
WHERE belnr = i_invoice-belnr
AND gjahr = i_invoice-gjahr
AND wrbtr <> 0
AND zzmprd IN s_zzmprd.
IF sy-subrc NE 0.
MESSAGE i000 WITH 'No Distribution Data Exists'(e10).
STOP.
ELSE.
SORT i_rbco BY belnr gjahr.
ENDIF.
ENDFORM. " get_rbco
*& Form get_material
Retrieve Material Document details from MARA & MARC
FORM get_material.
LOOP AT i_rbco INTO w_rbco.
SELECT SINGLE sop_cnt
INTO w_rbco_tmp-land1
FROM zsop_fame
WHERE fame_cnt = w_rbco-zzcou.
IF sy-subrc = 0.
w_rbco_tmp-bukrs = w_rbco-bukrs.
w_rbco_tmp-ewlnr = w_rbco-sgtxt+7(2).
w_rbco_tmp-distmeth = w_rbco-sgtxt+0(3).
ENDIF.
w_rbco-land1 = w_rbco_tmp-land1.
APPEND w_rbco_tmp TO i_rbco_tmp.
CLEAR w_rbco_tmp.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = w_rbco-zzmprd
IMPORTING
output = w_rbco-matnr
EXCEPTIONS
length_error = 1
OTHERS = 2.
MODIFY i_rbco FROM w_rbco.
CLEAR w_rbco.
ENDLOOP.
SELECT a~matnr " Material Number
a~normt " Article Number
a~ismconttype " Window
a~ismdesign " No of discs in MPM
b~werks " Plant
b~mfrgr " Product Line
INTO TABLE i_material
FROM mara AS a
INNER JOIN
marc AS b
ON amatnr = bmatnr
FOR ALL ENTRIES IN i_rbco
WHERE a~matnr = i_rbco-matnr.
IF sy-subrc = 0.
SORT i_material BY matnr.
ENDIF.
ENDFORM. " get_material
*& Form get_costtype
Retrieve costtype details from zsn0325_costtype
FORM get_costtype.
SELECT bukrs " Company code
land1 " Country key
window " Window
ewlnr " Cost type
distmeth " Distribution type
zvalfrom " Invoice date
zvalto " Invoice date
disc1pr " Disc Price
disc2pr " Additional DiscPrice
FROM zsn0325_costtype
INTO TABLE i_costtype
FOR ALL ENTRIES IN i_rbco_tmp
WHERE bukrs = i_rbco_tmp-bukrs
AND ewlnr = i_rbco_tmp-ewlnr
AND distmeth = i_rbco_tmp-distmeth
AND land1 = i_rbco_tmp-land1.
IF sy-subrc = 0.
SORT i_costtype BY bukrs land1 window ewlnr distmeth.
ENDIF.
ENDFORM. " get_costtype
*& Form get_distmeth
Retrieve costtype details from zsn0325_distmeth
FORM get_distmeth.
SELECT distmeth
distext
FROM zsn0325_distmeth
INTO TABLE i_distmeth
FOR ALL ENTRIES IN i_costtype
WHERE distmeth = i_costtype-distmeth.
IF sy-subrc = 0.
SORT i_distmeth BY distmeth.
ENDIF.
ENDFORM. " get_distmeth
*& Form display_report
TO Display Output
FORM display_report.
IF NOT i_output[] IS INITIAL.
SORT i_output BY xblnr.
PERFORM build_fieldcat.
ENDIF.
ENDFORM. " display_report
*& Form build_fieldcat
Build Field Catalog
FORM build_fieldcat.
PERFORM fill_fieldcat USING 'BUKRS' 'I_OUTPUT'
'Company Code'(001) 12.
PERFORM fill_fieldcat USING 'LIFNR' 'I_OUTPUT'
'Vendor'(002) 6.
PERFORM fill_fieldcat USING 'ZLSPR' 'I_OUTPUT'
'Payment Block'(003) 13.
PERFORM fill_fieldcat USING 'XBLNR' 'I_OUTPUT'
'Vendor Invoice No'(004) 17.
PERFORM fill_fieldcat USING 'BLDAT' 'I_OUTPUT'
'Invoice Date'(005) 12.
PERFORM fill_fieldcat USING 'BUDAT' 'I_OUTPUT'
'Posting Date'(006) 12.
PERFORM fill_fieldcat USING 'BKTXT' 'I_OUTPUT'
'Invoice Type'(007) 12.
PERFORM fill_fieldcat USING 'BELNR' 'I_OUTPUT'
'R/3 Invoice No'(008) 14.
PERFORM fill_fieldcat USING 'COBL_NR' 'I_OUTPUT'
'Line Item'(009) 9.
PERFORM fill_fieldcat USING 'NORMT' 'I_OUTPUT'
'Article No'(010) 10.
PERFORM fill_fieldcat USING 'ZZMPRD' 'I_OUTPUT'
'MPM Product'(034) 11.
PERFORM fill_fieldcat USING 'ISMCONTTYPE' 'I_OUTPUT'
'Window'(011) 6.
PERFORM fill_fieldcat USING 'NDISC' 'I_OUTPUT'
'No of Discs on invoice'(012) 22.
PERFORM fill_fieldcat USING 'ISMDESIGN' 'I_OUTPUT'
'No of discs on MPM'(013) 10.
PERFORM fill_fieldcat USING 'DISTMETH' 'I_OUTPUT'
'Distribution type'(014) 17.
PERFORM fill_fieldcat USING 'DISTEXT' 'I_OUTPUT'
'Description'(015) 11.
PERFORM fill_fieldcat USING 'DDEAL' 'I_OUTPUT'
'Distribution Deal'(016) 17.
PERFORM fill_fieldcat USING 'MFRGR' 'I_OUTPUT'
'MPM Product Line'(017) 16.
PERFORM fill_fieldcat USING 'ZZCOU' 'I_OUTPUT'
'Country'(018) 7.
PERFORM fill_fieldcat USING 'XNEGP' 'I_OUTPUT'
'Qty Var flag'(019) 12.
PERFORM fill_fieldcat USING 'INVFQTY' 'I_OUTPUT'
'Inv fee Qty'(020) 11.
PERFORM fill_fieldcat USING 'RIFVAL' 'I_OUTPUT'
'Inv fee Value'(021) 13.
PERFORM fill_fieldcat USING 'STDRIF' 'I_OUTPUT'
'Std Inv fee'(022) 11.
PERFORM fill_fieldcat USING 'RFVAR' 'I_OUTPUT'
'Inv fee Var'(023) 11.
PERFORM fill_fieldcat USING 'DISCQTY' 'I_OUTPUT'
'Dis cost Qty'(024) 11.
PERFORM fill_fieldcat USING 'DICVAL' 'I_OUTPUT'
'Dist Cost Value'(025) 15.
PERFORM fill_fieldcat USING 'STDDICO' 'I_OUTPUT'
'Std Dist Cost'(026) 11.
PERFORM fill_fieldcat USING 'DICVAR' 'I_OUTPUT'
'Dist Cost Var'(027) 13.
PERFORM fill_fieldcat USING 'DISRQTY' 'I_OUTPUT'
'Dis Ret Qty'(028) 11.
PERFORM fill_fieldcat USING 'DISREV' 'I_OUTPUT'
'Dis Ret Value'(029) 11.
PERFORM fill_fieldcat USING 'STDIRCO' 'I_OUTPUT'
'Std Dis Ret cost'(030) 11.
PERFORM fill_fieldcat USING 'DREVAR' 'I_OUTPUT'
'Dis Ret Var'(031) 11.
PERFORM fill_fieldcat USING 'ADJ_QTY_CT' 'I_OUTPUT'
'Adjustments Qty'(035) 15.
PERFORM fill_fieldcat USING 'ADJ_PR_CT' 'I_OUTPUT'
'Adjustments Value'(036) 17.
PERFORM fill_fieldcat USING 'SSEQTY' 'I_OUTPUT'
'Special Ser Qty'(032) 15.
PERFORM fill_fieldcat USING 'SSVAL' 'I_OUTPUT'
'Special Ser Value'(033) 17.
ENDFORM. " build_fieldcat
*& Form fill_fieldcat
Fill fieldcatalog for ALV *
FORM fill_fieldcat USING value(p_fieldname)
value(p_tabname)
value(p_seltext_m)
value(p_outputlen).
w_fieldcatalog-fieldname = p_fieldname.
w_fieldcatalog-ref_table = p_tabname.
w_fieldcatalog-coltext = p_seltext_m.
w_fieldcatalog-outputlen = p_outputlen.
APPEND w_fieldcatalog TO i_fieldcatalog.
CLEAR w_fieldcatalog.
ENDFORM. " fill_fieldcat
*& Module STATUS_0100 OUTPUT
Process Before output
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN1'.
SET TITLEBAR 'TITLE'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module alV_display OUTPUT
ALv Display in PBO *
MODULE alv_display OUTPUT.
IF w_ccontainer IS INITIAL.
PERFORM create_objects.
Excluding unnecessary function codes from the grid
PERFORM exclude_fcodes.
PERFORM display_alv_grid.
ENDIF.
ENDMODULE. " alV_display OUTPUT
*& Form create_objects
Create ALV Objects
FORM create_objects.
IF w_alvgrid IS INITIAL .
*----Creating custom container instance
CREATE OBJECT w_ccontainer
EXPORTING
container_name = 'CONTAINER'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6 .
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
*----Creating ALV Grid instance
CREATE OBJECT w_alvgrid
EXPORTING
i_parent = w_ccontainer
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
others = 5 .
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
*--Create Event Receiver
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->handle_top_of_page FOR w_alvgrid.
ENDIF.
ENDFORM. " create_objects
*& Form display_alv_grid
Display ALV Grid
FORM display_alv_grid.
w_layout-grid_title = 'Distribution Report'(042).
IF NOT w_alvgrid IS INITIAL .
MOVE 'COLOR_CELL' TO w_layout-ctab_fname.
CALL METHOD w_alvgrid->set_table_for_first_display
EXPORTING
is_layout = w_layout
it_toolbar_excluding = i_toolbar_excluding[]
I_DEFAULT = 'X'
CHANGING
it_outtab = i_output_tmp[]
it_fieldcatalog = i_fieldcatalog[]
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4 .
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
ELSE .
CALL METHOD w_alvgrid->refresh_table_display
EXCEPTIONS
finished = 1
OTHERS = 2 .
IF sy-subrc <> 0.
ENDIF.
ENDIF .
*--handler for ALV grid
SET HANDLER event_receiver->handle_double_click FOR w_alvgrid.
ENDFORM. " display_alv_grid
*& Module USER_COMMAND_0100 INPUT
At User Command
MODULE user_command_0100 INPUT.
MOVE sy-ucomm TO w_okcode.
CASE w_okcode.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form populate_output
Populate internal table for output
FORM populate_output.
DATA: lv_invval TYPE rbco-wrbtr.
LOOP AT i_rbco INTO w_rbco.
*-Check whether ndisc is numeric value.
IF w_rbco-sgtxt+4(2) CO '0123456789'.
MOVE: w_rbco-sgtxt+4(2) TO w_output-ndisc.
ENDIF.
MOVE:w_rbco-cobl_nr TO w_output-cobl_nr,
w_rbco-zzcou TO w_output-zzcou,
w_rbco-zzmprd TO w_output-zzmprd,
w_rbco-xnegp TO w_output-xnegp.
For Invoice
READ TABLE i_invoice INTO w_invoice WITH KEY belnr = w_rbco-belnr
gjahr = w_rbco-gjahr
BINARY SEARCH.
IF sy-subrc = 0.
MOVE: w_invoice-bukrs TO w_output-bukrs,
w_invoice-lifnr TO w_output-lifnr,
w_invoice-zlspr TO w_output-zlspr, -
How we can use class and methods for the FM of reuse_alv_list_display
Hi Abapers,
Please provide the sample code of class and method of REUSE_ALV_LIST_DISPLAY.
Which Class i can use for this Function module.
I need to write a code using OOPS concept.
I was done the GRID display using this class cl_gui_alv_grid.
But i want only List Display using the class & methods.
Plz provide sample code.
Thanks
Nani.Hi Nani,
This is the sample code..
*& Report Z_OO_ALV
*& We can Use Two containers in OOALV
REPORT z_oo_alv LINE-COUNT 50.
*types gt_struct type sflight.
DATA BEGIN OF gt_struct.
INCLUDE STRUCTURE sflight.
DATA rcol(4) TYPE c.
DATA colors TYPE lvc_t_scol.
DATA END OF gt_struct.
*ALV GRIDs
DATA gr_alvgrid TYPE REF TO cl_gui_alv_grid.
DATA gr_alvgrid1 TYPE REF TO cl_gui_alv_grid.
DATA gc_custom_control_name TYPE scrfname VALUE 'CC_ALV'.
DATA gc_custom_control_name1 TYPE scrfname VALUE 'CC_ALV1'.
*CONTAINERs
DATA gr_ccontainer TYPE REF TO cl_gui_custom_container.
DATA gr_ccontainer1 TYPE REF TO cl_gui_custom_container.
*FIELDCATALOGs
DATA gt_fieldcat TYPE lvc_t_fcat WITH HEADER LINE.
DATA gt_fieldcat1 TYPE lvc_t_fcat WITH HEADER LINE.
*LAYOUTs
DATA gs_layout TYPE lvc_s_layo.
DATA gs_layout1 TYPE lvc_s_layo.
DATA pt_exclude TYPE ui_functions. "internal table declaration to be passed.
*DATA pt_cell TYPE lvc_t_cell with header line.
DATA : gt_list LIKE gt_struct OCCURS 50 WITH HEADER LINE,
gt_list1 LIKE gt_struct OCCURS 50 WITH HEADER LINE.
*DATA v_ucomm TYPE sy-ucomm.
CALL SCREEN 100.
*& Module display_alv OUTPUT
text
MODULE display_alv OUTPUT.
PERFORM display_alv.
ENDMODULE. " display_alv OUTPUT
*& Module PAI INPUT
text
MODULE pai INPUT.
CASE sy-ucomm.
WHEN 'EXIT'.
PERFORM exit_program.
WHEN 'PICK'.
PERFORM cell_info.
ENDCASE.
ENDMODULE. " PAI INPUT
*& Form display_alv
text
FORM display_alv.
PERFORM prepare_field_catalog CHANGING gt_fieldcat[].
PERFORM prepare_layout CHANGING gs_layout.
PERFORM data_retrival.
IF gr_alvgrid IS INITIAL.
CREATE OBJECT gr_ccontainer
EXPORTING
container_name = gc_custom_control_name
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc <> 0.
ENDIF.
CREATE OBJECT gr_alvgrid
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
i_parent = gr_ccontainer
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
I_FCAT_COMPLETE = SPACE
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
PERFORM exclude_tb_functions CHANGING pt_exclude.
PERFORM set_col.
CALL METHOD gr_alvgrid->set_table_for_first_display
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
is_layout = gs_layout
IS_PRINT =
IT_SPECIAL_GROUPS =
it_toolbar_excluding = pt_exclude "excluding toolbar functions
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
IR_SALV_ADAPTER =
CHANGING
it_outtab = gt_list[]
it_fieldcatalog = gt_fieldcat[]
IT_SORT =
IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ELSE.
CALL METHOD gr_alvgrid->refresh_table_display
EXPORTING
IS_STABLE =
I_SOFT_REFRESH =
EXCEPTIONS
finished = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
PERFORM prepare_field_catalog1 CHANGING gt_fieldcat1[].
PERFORM prepare_layout1 CHANGING gs_layout1.
PERFORM data_retrival1.
IF gr_alvgrid1 IS INITIAL.
CREATE OBJECT gr_ccontainer1
EXPORTING
container_name = gc_custom_control_name1
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc <> 0.
ENDIF.
CREATE OBJECT gr_alvgrid1
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
i_parent = gr_ccontainer1
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
I_FCAT_COMPLETE = SPACE
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
PERFORM set_col1.
CALL METHOD gr_alvgrid1->set_table_for_first_display
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
is_layout = gs_layout1
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
IR_SALV_ADAPTER =
CHANGING
it_outtab = gt_list1[]
it_fieldcatalog = gt_fieldcat1[]
IT_SORT =
IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ELSE.
CALL METHOD gr_alvgrid1->refresh_table_display
EXPORTING
IS_STABLE =
I_SOFT_REFRESH =
EXCEPTIONS
finished = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM. "display_alv
*& Form prepare_field_catalog
text
-->GT_FIELDCAT text
FORM prepare_field_catalog CHANGING pgt_fieldcat TYPE lvc_t_fcat.
DATA ls_fieldcat TYPE lvc_s_fcat.
ls_fieldcat-tabname = 'gt_list'.
ls_fieldcat-fieldname = 'CARRID'.
ls_fieldcat-scrtext_m = 'Air line code'.
ls_fieldcat-col_pos = 0.
ls_fieldcat-outputlen = 10.
ls_fieldcat-emphasize = 'C400'.
ls_fieldcat-key = 'X'.
APPEND ls_fieldcat TO pgt_fieldcat.
ls_fieldcat-tabname = 'gt_list'.
ls_fieldcat-col_pos = 1.
ls_fieldcat-fieldname = 'CONNID'.
ls_fieldcat-scrtext_m = 'Connection code'.
ls_fieldcat-emphasize = 'C900'.
APPEND ls_fieldcat TO pgt_fieldcat.
ls_fieldcat-tabname = 'gt_list'.
ls_fieldcat-fieldname = 'PRICE'.
ls_fieldcat-scrtext_m = 'PRICE'.
APPEND ls_fieldcat TO pgt_fieldcat.
ENDFORM. "prepare_field_catalog
*& Form prepare_layout
text
-->GS_LAYOUT text
FORM prepare_layout CHANGING gs_layout TYPE lvc_s_layo.
gs_layout-stylefname = 'FIELD_STYLE'.
gs_layout-zebra = 'X'.
gs_layout-grid_title = 'FLIGHT'.
gs_layout-sel_mode = 'A'.
gs_layout-ctab_fname = 'COLORS'.
ENDFORM. "prepare_layout
*& Form data_retrival
text
FORM data_retrival.
SELECT carrid
connid
price
FROM sflight
INTO CORRESPONDING FIELDS OF TABLE gt_list
UP TO 50 ROWS.
ENDFORM. "data_retrival
FORM EXIT_PROGRAM *
FORM exit_program.
CALL METHOD gr_ccontainer->free.
CALL METHOD gr_ccontainer1->free.
LEAVE TO SCREEN 0.
ENDFORM. "exit_program
*& Module STATUS_0100 OUTPUT
text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STAT'.
SET TITLEBAR 'xxx'.
IF W_CUSTOM_CONTAINER IS INITIAL.
**sets TITLEBAR
PERFORM TITLEBAR.
ENDMODULE. " STATUS_0100 OUTPUT
*& Form prepare_field_catalog1
text
-->GT_FIELDCAT text
FORM prepare_field_catalog1 CHANGING pgt_fieldcat1 TYPE lvc_t_fcat.
DATA ls_fieldcat TYPE lvc_s_fcat.
ls_fieldcat-tabname = 'gt_list1'.
ls_fieldcat-fieldname = 'SEATSMAX'.
ls_fieldcat-scrtext_m = 'MAX. SEATS'.
ls_fieldcat-col_pos = 0.
ls_fieldcat-outputlen = 10.
ls_fieldcat-emphasize = 'C400'.
ls_fieldcat-key = ' '.
APPEND ls_fieldcat TO pgt_fieldcat1.
ls_fieldcat-tabname = 'gt_list1'.
ls_fieldcat-col_pos = 1.
ls_fieldcat-fieldname = 'SEATSOCC'.
ls_fieldcat-scrtext_m = 'SEATS OCCUPIED'.
APPEND ls_fieldcat TO pgt_fieldcat1.
ENDFORM. "prepare_field_catalog
*& Form prepare_layout1
text
-->GS_LAYOUT text
FORM prepare_layout1 CHANGING gs_layout1 TYPE lvc_s_layo.
gs_layout1-stylefname = 'FIELD_STYLE'.
gs_layout1-zebra = 'X'.
gs_layout1-grid_title = 'DETAILS'.
gs_layout-sel_mode = 'C'.
gs_layout1-info_fname = 'RCOL'.
gs_layout-no_toolbar = 'X'.
ENDFORM. "prepare_layout
*& Form data_retrival1
text
FORM data_retrival1.
SELECT seatsmax
seatsocc
FROM sflight
INTO CORRESPONDING FIELDS OF TABLE gt_list1
UP TO 50 ROWS.
ENDFORM. "data_retrival
*& Form exclude_tb_functions
&---- subroutine to exclude toolbar options -
text
-->PT_EXCLUDE text
FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions.
DATA ls_exclude TYPE ui_func.
ls_exclude = cl_gui_alv_grid=>mc_fc_maximum.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_minimum.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_subtot.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_sort.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_sum.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_mb_subtot.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_mb_sum.
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_mb_filter.
APPEND ls_exclude TO pt_exclude.
ENDFORM. "data_retrival1
*& Form cell_info
text
FORM cell_info. "CHANGING pt_cell TYPE lvc_t_cell.
DATA lt_cell TYPE lvc_t_cell WITH HEADER LINE.
CALL METHOD gr_alvgrid->get_selected_cells
IMPORTING
et_cell = lt_cell[].
LOOP AT lt_cell.
WRITE : lt_cell-col_id , lt_cell-row_id.
ENDLOOP.
MODIFY pt_cell[] from lt_cell[].
ENDFORM. "cell_info
*& Form set_col
text
FORM set_col .
DATA ls_cellcolor TYPE lvc_s_scol.
LOOP AT gt_list.
IF gt_list-price GT 500.
ls_cellcolor-fname = 'PRICE'.
ls_cellcolor-color-col = 5.
ls_cellcolor-color-int = 1.
ls_cellcolor-color-inv = 0.
APPEND ls_cellcolor TO gt_list-colors.
else.
ls_cellcolor-fname = 'PRICE'.
ls_cellcolor-color-col = 3.
ls_cellcolor-color-int = 1.
APPEND ls_cellcolor TO gt_list-colors.
ENDIF.
MODIFY gt_list.
ENDLOOP.
ENDFORM. "set_col
*& Form set_col1
text
FORM set_col1.
data : ind type sy-tabix,
indx type sy-tabix.
loop at gt_list1.
ind = sy-tabix / 2.
indx = sy-tabix - ind.
if indx eq ind.
gt_list1-rcol = 'C500'.
endif.
MODIFY gt_list1.
endloop.
ENDFORM. "set_col
*FORM TITLEBAR.
*SET TITLEBAR 'TITLE'.
*ENDFORM.
*double click on TITLE and write ur title
Thanks,
Samantak.
Rewards points for useful answers. -
Automatic Display of NEW Data in ALV Report using Classes and Methods
Hi,
I have developed a ALV Report for displaying data from a set of DB tables using ABAP OO, Classes and Methods. The requirement is to have the report output to be automatically updated with the new entries from the DB table at a regular frequency of tiem may be every two minutes.
Could anyone please tell me how can this be acheived.
Thanks and regards,
Raghavendra Goutham P.Yes its possible.
Take a look at this thread
Auto refresh of ALV Grid, without user interaction
Or Rich's blog
/people/rich.heilman2/blog/2005/10/18/a-look-at-clguitimer-in-46c
Regards,
Ravi
Note : Please mark all the helpful answers -
Receiving Mail - Using attachement and adapter attributes
Hi all,
I'm trying to solve the following problem:
- I receive a file via mail adapter as attachment
- The content of the file is plain text, no csv or XML
- For mapping, I need a) the content of the file b) metadata like sender of the mail, date/time of mail etc.
I tried to use mail package and PayloadSwapBean. Now I have the situation, that not everytime the <content>-Tag contains the content of the attachement:
-If the message text of the mail is empty, <content>-Tag contains the content of the attachment (perfect!)
-If the message text of the mail is empty, mapping throws exception. I suppose, that pure attachement (not in the mail package format) is input for mapping
If I try to use adapter-specific attributes, Mail adapter throws error (so message does not reach integration engine). I already updated the mail adapter metadata in the IR (cf. SAP note 936552), as we are on SP16. It seems as if still some tags can not be deserialised by the SOAP-Entry of the integration engine.
Has someone an idea how to solve the situation?
Kind regards,
Torsten
Message was edited by: Torsten EngelWell, the problem seems to be with the IMAP server
(not postfix).
I simply don't have an INBOX file were my IMAP server
seems to deliver the e-mail.
This seems to be part of our problem communicating. An IMAP server doesn't deliver email. It's what your mailreader contacts to view or deliver mail. You must be using OSX Server, I don't think there's an IMAP server for OSX.
When mail arrives at your Mac, two basic things happen. We lump them under the label postfix. The first thing is that the SMTP server accepts the mail. The second is that the local process "delivers" the mail. This can be difficult to set up, but the main thing is to put the local delivery path in the alias map file you set in /etc/postfix/main.cf. This is /etc/aliases by default.
To read mail, your mailreader can simply open the mailbox where the file was delivered. /usr/bin/mail will work fine. Fancier mailreaders like Apple Mail use protocols like POP3 and IMAP4 to retrieve mail from remote servers. But this case is different. IMAP seems like overkill since everything is local. I would try putting the alias to the directory that Mail uses. But then, you never said what your mailreader was, so I don't know.
I think we can solve this, but we need to get over some confusion first.
-Phil -
XI SOAP receiver adapter. Java and decentral adapter engine.
Hi,
I would like to send the below to a web service... have done a custom mapping to
produce the entire message below, and turned off Use SOAP envelope option in the
receiver adapter.
Can anyone point me in the right direction (in terms of the correct why to go about this)
or to why it is not working? Because I see it in the payload option of the message fine (in RWB).
Can java mapping be used to build the entire message?
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:noNamespaceSchemaLocation=" EnvelopeStructure.xsd">
<SOAP-ENV:Header>
<Q-ENV:Header>
<Q-ENV:Sender-Id>a03430170001</Q-ENV:Sender-Id>
<Q-ENV:Receiver-Id>1aa1150001</Q-ENV:Receiver-Id>
<Q-ENV:Correlation-Id>1231201109096878</Q-ENV:Correlation-Id>
<Q-ENV:Message-Id>M1231201109096878</Q-ENV:Message-Id>
<Q-ENV:Date-Sent>26 Apr 2004 18:01:08 CDT</Q-ENV:Date-Sent>
<Q-ENV:Document-Type>RequestForQuotation</Q-ENV:Document-Type>
<Q-ENV:Message-Format>Q 1.0</Q-ENV:Message-Format>
</Q-ENV:Header>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<Q-ENV:Body>
<Q-ENV:Content-Type>text/xml</Q-ENV:Content-Type>
<Q-ENV:Message-Type>xCBL</Q-ENV:Message-Type>
<Q-ENV:Encoding>UTF-8</Q-ENV:Encoding>
<Q-ENV:Message-Body>
blah blah
</Q-ENV:Message-Body>
</Q-ENV:Body>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
thanks
Dylan.I am getting various errors, because I am not sure I understand how this adapter works exactly.
I would like to send a custom SOAP message.
I use a java mapping to create the entire soap message...
In the soap adapter I turn on "Do not Use SOAP envelope".
What should the final message sent out of the SOAP adapter look like ? Will a standard SOAP
envelope be added around it anyway?
Do I need to add beans after the XISoapAdapter bean in order to remove the soap envelope?
How do the modules work? Is there a good resource on the subject? -
I can send but not receive email using Mail and Comcast
My incoming mail [Mac Mail 3.6(936) ] slowed and now has stopped. I get error message "mail.comcast.net" on port 995 timed out. I can send. I can receive at Comcast.net. I have tried changing the port setting to 101 and no SSL and 587 (the comcast online set up guide), etc. and sometimes it works once then fails again. I have deleted the p-list in the Mail Library and restarted and still nothing.
I deleted the account and set it up again but still no luck. Oddly the Preferences says deleting the Accounts will delete everything but the Mailboxes are still there. Part of the problem?
I do not have this issue using Thunderbird which is a program I do not like.
I used Comcast's various online guides, a long useless chat and useless email to no avail. My Primary Account Holder email (which I never use) works but not my every day email account.
MAC OS 10.5.8
MacBook Intel Core Duo
Mac Mail 3.6(936)*Sorry didn't see how old this thread was* Jono1968 if this could help you......
Here is what I would try -
Run the disk permissions utility....see if a repair works....
On the mail menu, go to Window => Connection Doctor - do you see errors (red dot) If so, what does it say the error is caused by?
Check this article out: http://support.apple.com/kb/ts1307
Rick
Message was edited by: rdvholtwood -
Soap Receiver adapter , Target URL and Soap Action
HI all,
WIll anyone tell me regarding Soap action, casue , they have given a URL which i have put in Target URL, but i am not able to understand what is SOap action what need to be put in this
Thankign you
Sridhari Sridhar,
In XI SOAP adapter we need two things:
SOAP URL: which is endpoint to the webserver.
SOAP action: describes particular method name we wanted to excute on that web applicaiton hosted on the webserver.
WSDL file has normally multiple operations(methods) , so we execute particular method by giving particular action name.
Action is not mandatory parameter i guess, this is in case , when wsdl is exposing only one method(action).
:Normally you can find SOAP Action element under element <SOAP:operation name = "XXX">
Hope this clears.
Cheers,
Div
Maybe you are looking for
-
IPad 2/3 - ICC Profile Recommendations
Since the iPad 2 and iPad 3 have different color gamuts (i.e. iPad 3 can display a wider range of hues and shades) is there a particular profile that's recommended when we're converting images for use in our books? I used to default to sRGB for the f
-
ORA-06519 while doing transactions
Hi, I have created a trigger on my transaction table. When a service is booked it is being inserted into two seperate tables. It is working fine, but at some times I am getting following error while recording the transactions. ORA-06519 Active autono
-
This is regarding the RRI jump. I am trying to jump from a report to a transaction. All the assignments are made to be generic. Now the problem is that when I try to execute this jump I get a warning stating that Selection for InfoObject cannot be u
-
Photoshop free trial did not download
I went thru the steps to download the free trial of photoshop, yet nothing happened after 4 hours. What should I do?
-
Sql error 12705 performing CON (Upgrade on Oracle10.2.0.2)
Hello, I'm following the Oracle Upgrade Guide_211 for Oracle upgrade to 10.2.0.2 of our test system. It's SAP R/3 4.6C with 4.6D_EXT supp. pack 2271, HP-UX 11.11 and Oracle 9.2.0.5 I'm almost done with the upgrade (just startup of SAP instance) Now I