ALV in ABAP Using OOPS Concept
ALV in ABAP Using OOPS Concept
Requirement :-
User will provide a range of input for Sales Document Number ( VBELN ).
We need to display details of that Sales Document Number from VBAK and VBAP table.
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 3 :- Now, we need to create a final type structure which will include fields from both
the type structures.
Step 4 :- Create internal table and work area for all the above type structures.
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.
Step 7 :- fill the data into the internal table of final table.
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.