0% found this document useful (0 votes)
13 views2 pages

Apr 10 12 - 15 PM

The document outlines an ABAP report program that retrieves sales order data based on user-defined date and order ID parameters. It constructs a table to display order details including order ID, date, material ID, quantity, and price, and allows for user interaction through selection checkboxes. Additionally, it includes functionality for handling user commands such as approving or rejecting selected orders.

Uploaded by

pudheena33
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Apr 10 12 - 15 PM

The document outlines an ABAP report program that retrieves sales order data based on user-defined date and order ID parameters. It constructs a table to display order details including order ID, date, material ID, quantity, and price, and allows for user interaction through selection checkboxes. Additionally, it includes functionality for handling user commands such as approving or rejecting selected orders.

Uploaded by

pudheena33
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

*&---------------------------------------------------------------------**& Report

ZTASK1*&---------------------------------------------------------------------
**&*&---------------------------------------------------------------------*REPORT
ZTASK1.DATA: P_DATE TYPE ZODATE.SELECT-OPTIONS P_DATEE FOR P_DATE
OBLIGATORY.PARAMETERS: P_OID TYPE ZOID.TYPES: BEGIN OF SALES_ORD, OID TYPE ZOID,
DATE TYPE ZODATE, MID TYPE ZIID, QUANTITY TYPE ZQUAN, PRICE TYPE ZOA, selected
TYPE c, END OF SALES_ORD.DATA: IT_ORD TYPE TABLE OF SALES_ORD, WA_ORD TYPE
SALES_ORD.IF P_OID = 0. SELECT T1~OID T1~ODATE T2~ITEM_ID
T2~QUANTITY T2~PRICE INTO table IT_ORD FROM ZORD_H AS T1 INNER
JOIN ZORD_I AS T2 ON T1~OID = T2~ORDER_ID WHERE T1~ODATE IN P_DATEE.ELSE.
SELECT T1~OID T1~ODATE T2~ITEM_ID T2~QUANTITY
T2~PRICE INTO table IT_ORD FROM ZORD_H AS T1 INNER JOIN ZORD_I AS T2
ON T1~OID = T2~ORDER_ID WHERE T1~ODATE IN P_DATEE AND T1~OID = P_OID.ENDIF.
DATA: i_sfcat TYPE slis_t_fieldcat_alv, wa_sfcat TYPE slis_fieldcat_alv.*
ls_layout TYPE slis_layout_alv. DATA: V_POS TYPE N. v_pos = 1. wa_sfcat-
col_pos = v_pos. wa_sfcat-fieldname = 'SELECTED'. wa_sfcat-checkbox = 'X'.
wa_sfcat-seltext_l = 'Select'. wa_sfcat-edit = 'X'. APPEND wa_sfcat TO i_sfcat.
clear wa_sfcat. v_pos = v_pos + 1. wa_sfcat-col_pos = v_pos. wa_sfcat-fieldname
= 'OID'. wa_sfcat-tabname = 'IT_ORD'. wa_sfcat-outputlen = 10. wa_sfcat-
seltext_l = 'ORDER ID'. append wa_sfcat to i_sfcat. clear wa_sfcat. v_pos =
v_pos + 1. wa_sfcat-col_pos = v_pos. wa_sfcat-fieldname = 'DATE'. wa_sfcat-
tabname = 'IT_ORD'. wa_sfcat-outputlen = 10. wa_sfcat-seltext_l = 'DATE'. append
wa_sfcat to i_sfcat. clear wa_sfcat. v_pos = v_pos + 1. wa_sfcat-col_pos =
v_pos. wa_sfcat-fieldname = 'MID'. wa_sfcat-tabname = 'IT_ORD'. wa_sfcat-
outputlen = 10. wa_sfcat-seltext_l = 'MATERIAL ID'. append wa_sfcat to i_sfcat.
clear wa_sfcat. v_pos = v_pos + 1. wa_sfcat-col_pos = v_pos. wa_sfcat-fieldname
= 'QUANTITY'. wa_sfcat-tabname = 'IT_ORD'. wa_sfcat-outputlen = 10. wa_sfcat-
seltext_l = 'QUANTITY'.* wa_sfcat-edit = 'X'. append wa_sfcat to i_sfcat. clear
wa_sfcat. v_pos = v_pos + 1. wa_sfcat-col_pos = v_pos. wa_sfcat-fieldname =
'PRICE'. wa_sfcat-tabname = 'IT_ORD'. wa_sfcat-outputlen = 10. wa_sfcat-
seltext_l = 'PRICE'. append wa_sfcat to i_sfcat. clear wa_sfcat.* ls_layout-
box_fieldname = 'SELECTED'. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING*
I_INTERFACE_CHECK = ' '* I_BYPASSING_BUFFER = '
'* I_BUFFER_ACTIVE = ' ' I_CALLBACK_PROGRAM
= SY-REPID I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USR_COMMAND'* I_CALLBACK_TOP_OF_PAGE
= ' '* I_CALLBACK_HTML_TOP_OF_PAGE = ' '* I_CALLBACK_HTML_END_OF_LIST
= ' '* I_STRUCTURE_NAME =* I_BACKGROUND_ID
= ' '* I_GRID_TITLE =* I_GRID_SETTINGS
=* IS_LAYOUT = LS_LAYOUT IT_FIELDCAT
= i_sfcat* IT_EXCLUDING =* IT_SPECIAL_GROUPS
=* IT_SORT =* IT_FILTER
=* IS_SEL_HIDE =* I_DEFAULT =
'X'* I_SAVE = ' '* IS_VARIANT
=* IT_EVENTS =* IT_EVENT_EXIT
=* IS_PRINT =* IS_REPREP_ID
=* I_SCREEN_START_COLUMN = 0* I_SCREEN_START_LINE
= 0* I_SCREEN_END_COLUMN = 0* I_SCREEN_END_LINE
= 0* I_HTML_HEIGHT_TOP = 0* I_HTML_HEIGHT_END
= 0* IT_ALV_GRAPHICS =* IT_ADD_FIELDCAT
=* IT_EXCEPT_QINFO =* IR_SALV_FULLSCREEN_ADAPTER
=* IMPORTING* E_EXIT_CAUSED_BY_CALLER =* ES_EXIT_CAUSED_BY_USER
= TABLES T_OUTTAB = IT_ORD* EXCEPTIONS*
PROGRAM_ERROR = 1* OTHERS = 2
. IF SY-SUBRC <> 0.* Implement suitable error handling here ENDIF. FORM
PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB. SET PF-STATUS 'ACTION_BUTTON'.
ENDFORM. FORM USR_COMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE
SLIS_SELFIELD. IF R_UCOMM EQ 'APPROVE'. LOOP AT IT_ORD INTO WA_ORD WHERE
SELECTED = 'X'. WRITE: / 'Selected:', WA_ORD-SELECTED, 'OID:', WA_ORD-OID.
ENDLOOP. ENDIF. IF R_UCOMM = 'REJECT'. " Add your reject logic here ENDIF.
ENDFORM.

You might also like