SAP Program [Module Pool- Adding Subscreen ]
SELECTION-SCREEN BEGIN OF SCREEN 400 AS SUBSCREEN .
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS :"p_maktx TYPE makt-maktx OBLIGATORY, "<~~ Material Description
p_meins TYPE mara-meins OBLIGATORY DEFAULT 'M',
p_spart TYPE mara-spart OBLIGATORY , "<~~ Division
p_prdha TYPE mara-prdha OBLIGATORY ,
p_prctr TYPE marc-prctr OBLIGATORY .
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 400 .
CALL SCREEN '9001'.
PROCESS BEFORE OUTPUT.
MODULE status_9001.
CALL SUBSCREEN sub_1 INCLUDING sy-repid '400'.
PROCESS AFTER INPUT.
CALL SUBSCREEN sub_1 . "including sy-repid '400'.
MODULE user_command_9001.
PROCESS ON VALUE-REQUEST.
FIELD wa_comp-sel101 MODULE create_dropdown_box.
FIELD wa_comp-sel201 MODULE create_dropdown_box.
FIELD wa_comp-sel301 MODULE create_dropdown_box.
FIELD wa_comp-sel401 MODULE create_dropdown_box.
FIELD wa_comp-sel501 MODULE create_dropdown_box.
FIELD wa_comp-sel102 MODULE fill_composition.
FIELD wa_comp-sel202 MODULE fill_composition.
FIELD wa_comp-sel302 MODULE fill_composition.
FIELD wa_comp-sel402 MODULE fill_composition.
FIELD wa_comp-sel502 MODULE fill_composition.
FIELD wa_comp-category MODULE fill_category.
___________________________________________________________________
*&---------------------------------------------------------------------*
*& Module CREATE_DROPDOWN_BOX INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE create_dropdown_box INPUT.
CLEAR :count ,it_selection[].
IF wa_comp-sel101 IS INITIAL OR wa_comp-sel201 IS INITIAL OR wa_comp-sel301 IS INITIAL OR wa_comp-sel401 IS INITIAL OR wa_comp-sel501 IS INITIAL OR
wa_comp-sel102 IS INITIAL OR wa_comp-sel202 IS INITIAL OR wa_comp-sel302 IS INITIAL OR wa_comp-sel402 IS INITIAL OR wa_comp-sel502 IS INITIAL .
DO 100 TIMES.
count = count + 1 .
sel_id = count.
CONCATENATE sel_id '%' INTO wa_selection-sel_val .
APPEND wa_selection TO it_selection .
ENDDO.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'NAME1'
value_org = 'S'
TABLES
value_tab = it_selection
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
...
ENDIF.
ENDIF.
ODULE. " CREATE_DROPDOWN_BOX INPUT
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS :"p_maktx TYPE makt-maktx OBLIGATORY, "<~~ Material Description
p_meins TYPE mara-meins OBLIGATORY DEFAULT 'M',
p_spart TYPE mara-spart OBLIGATORY , "<~~ Division
p_prdha TYPE mara-prdha OBLIGATORY ,
p_prctr TYPE marc-prctr OBLIGATORY .
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 400 .
CALL SCREEN '9001'.
PROCESS BEFORE OUTPUT.
MODULE status_9001.
CALL SUBSCREEN sub_1 INCLUDING sy-repid '400'.
PROCESS AFTER INPUT.
CALL SUBSCREEN sub_1 . "including sy-repid '400'.
MODULE user_command_9001.
PROCESS ON VALUE-REQUEST.
FIELD wa_comp-sel101 MODULE create_dropdown_box.
FIELD wa_comp-sel201 MODULE create_dropdown_box.
FIELD wa_comp-sel301 MODULE create_dropdown_box.
FIELD wa_comp-sel401 MODULE create_dropdown_box.
FIELD wa_comp-sel501 MODULE create_dropdown_box.
FIELD wa_comp-sel102 MODULE fill_composition.
FIELD wa_comp-sel202 MODULE fill_composition.
FIELD wa_comp-sel302 MODULE fill_composition.
FIELD wa_comp-sel402 MODULE fill_composition.
FIELD wa_comp-sel502 MODULE fill_composition.
FIELD wa_comp-category MODULE fill_category.
___________________________________________________________________
*&---------------------------------------------------------------------*
*& Module CREATE_DROPDOWN_BOX INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE create_dropdown_box INPUT.
CLEAR :count ,it_selection[].
IF wa_comp-sel101 IS INITIAL OR wa_comp-sel201 IS INITIAL OR wa_comp-sel301 IS INITIAL OR wa_comp-sel401 IS INITIAL OR wa_comp-sel501 IS INITIAL OR
wa_comp-sel102 IS INITIAL OR wa_comp-sel202 IS INITIAL OR wa_comp-sel302 IS INITIAL OR wa_comp-sel402 IS INITIAL OR wa_comp-sel502 IS INITIAL .
DO 100 TIMES.
count = count + 1 .
sel_id = count.
CONCATENATE sel_id '%' INTO wa_selection-sel_val .
APPEND wa_selection TO it_selection .
ENDDO.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'NAME1'
value_org = 'S'
TABLES
value_tab = it_selection
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
...
ENDIF.
ENDIF.
ODULE. " CREATE_DROPDOWN_BOX INPUT
Comments
Post a Comment