2023 May 24 7:06 PM
TYPES: BEGIN OF ty_mara,
matnr type matnr,
end of ty_mara.
TYPES: BEGIN OF ty_marc,
werks type werks_d,
end of ty_marc.
TYPES: BEGIN OF ty_marm,
meinh type meinh,
end of ty_marm.
DATA: it_mara type STANDARD TABLE OF ty_mara, wa_mara type ty_mara.
DATA: it_marc type STANDARD TABLE OF ty_marc, wa_marc type ty_marc.
DATA: it_marm type STANDARD TABLE OF ty_marm, wa_marm type ty_marm.
DATA : TABLE_NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST.
PARAMETERS : TABLES TYPE spfli-carrid AS LISTBOX VISIBLE LENGTH 10 user-command TABLE_NAME. PARAMETERS : p_MATNR type matnr, p_WERKS type werks, p_MEINH type meinh.
AT SELECTION-SCREEN OUTPUT.
TABLE_NAME = 'TABLES'.
VALUE-KEY = '1'.
VALUE-TEXT = 'MARA'.
APPEND VALUE TO LIST.
VALUE-KEY = '2'.
VALUE-TEXT = 'MARC'.
APPEND VALUE TO LIST.
VALUE-KEY = '3'.
VALUE-TEXT = 'MARM'.
APPEND VALUE TO LIST.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING ID = TABLE_NAME VALUES = LIST.
START-OF-SELECTION.
WRITE : /'TABLE_NAME' , TABLES.
SELECTION-SCREEN: SKIP.
AT SELECTION-SCREEN.
IF TABLE_NAME = 'MARM'.
ENDIF.
CASE TABLE_NAME.
WHEN 'MARM'.
LOOP AT SCREEN.
IF screen-name cs 'P_MATNR'.
screen-active = 0.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDCASE.
SELECT matnr from mara into wa_mara where matnr = p_matnr.
ENDSELECT.
SELECT werks from marc into wa_marc where werks = p_werks.
ENDSELECT.
SELECT meinh from marm into wa_marm where meinh = p_meinh.
ENDSELECT.
this is my code, I need a code that helps me change my parameters on the selection screen based on the selection made in the listbox
2023 May 24 7:07 PM
Thank you for visiting SAP Community to get answers to your questions. Since this is your first question, I recommend that you familiarize yourself with Community Q&A, as the overview provides tips for preparing questions that draw responses from our members.
Should you wish, you can revise your question by selecting Actions, then Edit.
By adding a Picture to your profile you encourage readers to respond.
2023 May 24 8:27 PM
Please edit your question (Actions>Edit), select your code and press the button [CODE], which makes the code appear colored/indented, it'll be easier for people to look at it. Thanks!
2023 May 24 8:30 PM
That's quite a meaningless title!
A better title could be: "Change fields in selection screen when user selects other value in listbox"
2023 May 25 7:08 AM
You need an ABAP code, here is an ABAP code
TYPES: BEGIN OF ty_mara,
matnr TYPE matnr,
END OF ty_mara.
TYPES: BEGIN OF ty_marc,
werks TYPE werks_d,
END OF ty_marc.
TYPES: BEGIN OF ty_marm,
meinh TYPE meinh,
END OF ty_marm.
DATA: it_mara TYPE STANDARD TABLE OF ty_mara, wa_mara TYPE ty_mara.
DATA: it_marc TYPE STANDARD TABLE OF ty_marc, wa_marc TYPE ty_marc.
DATA: it_marm TYPE STANDARD TABLE OF ty_marm, wa_marm TYPE ty_marm.
DATA : table_name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.
PARAMETERS : tables TYPE spfli-carrid AS LISTBOX VISIBLE LENGTH 10 USER-COMMAND table_name.
PARAMETERS : p_matnr TYPE matnr MODIF ID mat, p_werks TYPE werks, p_meinh TYPE meinh.
AT SELECTION-SCREEN OUTPUT.
table_name = 'TABLES'.
value-key = '1'.
value-text = 'MARA'.
APPEND value TO list.
value-key = '2'.
value-text = 'MARC'.
APPEND value TO list.
value-key = '3'.
value-text = 'MARM'.
APPEND value TO list.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = table_name
values = list.
CASE tables.
WHEN '3'.
LOOP AT SCREEN.
IF screen-group1 = 'MAT'.
* screen-active = 0.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDCASE.
START-OF-SELECTION.
WRITE : /'TABLE_NAME' , tables.
SELECTION-SCREEN: SKIP.
AT SELECTION-SCREEN.
IF table_name = 'MARM'.
ENDIF.
SELECT matnr FROM mara INTO wa_mara WHERE matnr = p_matnr.
ENDSELECT.
SELECT werks FROM marc INTO wa_marc WHERE werks = p_werks.
ENDSELECT.
SELECT meinh FROM marm INTO wa_marm WHERE meinh = p_meinh.
ENDSELECT.