![]() |
Here is a list of popular ABAP commands including information about what it does and example code of how to use. They are also ordered in such a way that you can implement them one by one and gradually build a working ABAP report and beyond. TYPES - Creates type value that can be used by variables within your ABAP code. i.e. can declare an internal table field structure which can be assigned using the DATA statement to create an internal table.
TYPES: BEGIN OF t_summary, lineid type i, title type string, field1 type n, filed2 type i, total type i, end of t_summary.
DATA: it_summary type STANDARD TABLE OF t_summary, wa_summary like line of it_summary, ld_stell type pa0001-stell, ld_pernr type pa0001-pernr, it_pa0001 type STANDARD TABLE OF pa0001, wa_pa0001 like line of it_pa0001.
PARAMETERS: p_pernr like pa0001-pernr OBLIGATORY.
SELECT single stell from pa0001 into ld_stell where pernr eq p_pernr and begda le sy-datum and endda ge sy-datum. SELECT single * from pa0001 into table it_pa0001 where pernr eq ld_pernr and begda le sy-datum and endda ge sy-datum.
WRITE:/ ld_stell.
LOOP AT it_pa0001 into wa_pa0001. WRITE:/ wa_pa0001-orgeh. �display org unit ENDLOOP.
READ TABLE it_summary into wa_summary with key lineid = �10�.
FORM build_fieldcatalog USING p_field. wa_fieldcat-fieldname = p_field. wa_fieldcat-scrtext_s = 'Job Title (SAP)' . wa_fieldcat-scrtext_m = 'Job Title (SAP)'. wa_fieldcat-scrtext_l = 'Job Title (SAP)' . wa_fieldcat-no_out = 'X'. insert wa_fieldcat into it_fieldcat index ld_tabix. ENDFORM.
PERFORM build_fieldcatalog using �LINEID�.
CALL FUNCTION 'POPUP_TO_CONFIRM' EXPORTING text_question = ld_text display_cancel_button = c_no IMPORTING answer = ld_answer.
IF ld_pernr EQ �111111�. clear: ld_stell. ELSEIF ld_pernr EQ �222222�. refresh: it_pa0001. ENDIF.
CASE ld_pernr. WHEN �111111�. clear: ld_stell. WHEN �222222�. refresh: it_pa0001. ENDCASE.