SAP OOABAP 2
SAP OOABAP 2
Requirement :-
User will provide a range of input for Sales Document Number ( VBELN ).
We will display the details in form of ALV using the OOPS Concept.
Solution :-
Step 1 :- Create a executable program in ABAP Editor ( SE38 ).
Step 2 :- Create a type structure for few fields from VBAK table and for few
fields from VBAP table.
Step 4 :- Create internal table and work area for all the above type structures.
Step 5 :- Create a select option, for Sales Document number, in which user will
provide the input on Selection screen.
Step 6 :- In Start of Selection event we will write the select query to fetch data
from VBAK table and VBAP table based on user input in Sales Document
Number.
We have pass the the object of container as the parent for child.
START-OF-SELECTION.
select vbeln erdat erzet ernam vbtyp
from vbak into table lt_vbak
where vbeln in s_vbeln.
If lt_vbak is not INITIAL.
select vbeln posnr matnr
from vbap
into table lt_vbap
FOR ALL ENTRIES IN lt_vbak
where vbeln = lt_vbak-vbeln.
CHANGING
it_outtab = lt_final
it_fieldcatalog = lt_fieldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4
.
endif.
*&--------------------------------------------------------------
*&End of Program
*&--------------------------------------------------------------
Press F8.