2022 May 06 3:19 PM
Hello,
I have an interface (the full code pasted below, as it's short) which should be accessed when the user enters the transaction. There three buttons should appear for them and upon pushing one, XYZ_MAIN program should be SUBMITTED and have the user's choice passed into it via SELECTION-TABLE rspar.
XYZ_MAIN should receive the input within its own SELECTION-SCREEN (invisible to the user!) and, based on what was passed to the program from the interface, one of three screens should be displayed.
My problem is I have no idea how XYZ_MAIN is supposed to receive the passed input. Firstly I did all of it simply by EXPORTING the chosen option to ABAP MEMORY and then IMPORTING it within XYZ_MAIN and it worked like a charm, but I should be using "SUBMIT...WITH SELECTION-TABLE..." instead, I am told and I am lost.
Whether all fields of rspar (selname, kind, low, etc) have values assigned to them or not seems to make no difference. I tried having PARAMETERS within XYZ_MAIN as string and radiobuttons (as the example program I tried to utilise for learning has it like that). Debugger keeps showing me that XYZ_MAIN is indeed SUBMITTED and the control is passed to it, but it doesn't read the data I am trying to pass from my interface (in rspar table).
Any idea what I am doing wrong? Or what should I look into? All google results keep pointing at using ABAP MEMORY, which I am not supposed to do.
Here is my interface:
DATA: rspar TYPE TABLE OF rsparams WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF BLOCK A1 WITH FRAME TITLE text-001 NO INTERVALS.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 1(20) obor USER-COMMAND fc_obor.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 1(20) lubn USER-COMMAND fc_lubn.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 1(20) bial USER-COMMAND fc_bial.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK A1.
INITIALIZATION.
obor = 'Oborniki'.
lubn = 'Lubna'.
bial = 'Bialystok'.
AT SELECTION-SCREEN.
CASE sy-ucomm.
WHEN 'FC_OBOR'.
rspar-selname = 'obor'.
rspar-kind = 'P'.
APPEND rspar.
SUBMIT ZRABEN_MAIN WITH SELECTION-TABLE rspar.
WHEN 'FC_LUBN'.
rspar-selname = 'lubn'.
rspar-kind = 'P'.
APPEND rspar.
SUBMIT ZRABEN_MAIN WITH SELECTION-TABLE rspar.
WHEN 'FC_BIAL'.
rspar-selname = 'bial'.
rspar-kind = 'P'.
APPEND rspar.
SUBMIT XYZ_MAIN WITH SELECTION-TABLE rspar.
ENDCASE.
Here is the XYZ_MAIN:
SELECTION-SCREEN BEGIN OF BLOCK box1.
PARAMETERS: obor RADIOBUTTON GROUP gr1,
lubn RADIOBUTTON GROUP gr1,
bial RADIOBUTTON GROUP gr1.
SELECTION-SCREEN END OF BLOCK box1.
IF obor = 'X'.
WRITE: 'Hello from XYZ_MAIN, Oborniki.'.
ELSEIF lubn = 'X'.
WRITE: 'Hello from XYZ_MAIN, Lubna.'.
ELSEIF bial = 'X'.
WRITE: 'Hello from XYZ_MAIN, Bialystok.'.
ELSE.
WRITE: 'Lmao!'.
ENDIF.
Thank you for your time.
Kind Regards,
Bartek
2022 May 06 3:57 PM
As rule-of-thumb, pass all literal technical names as UPPER CASE. ('OBOR', etc.)
Pass the value 'X' in RSPAR-LOW.
2022 May 06 3:57 PM
As rule-of-thumb, pass all literal technical names as UPPER CASE. ('OBOR', etc.)
Pass the value 'X' in RSPAR-LOW.
2022 May 06 5:09 PM
Hey Sandra,
If you could remake this comment into an answer, I could mark it as the Accepted one (if this question is worth keeping it here), because these two things just solved my problem and made my evening. 🙂
Before, I had rspar-low = 'X' set but it seemed to make no difference, so I removed it.
It didn't occur to me that string literals might be case-sensitive.
Thanks a lot.
2022 May 06 5:41 PM
Done. Wasn't sure, as I said it's a rule-of-thumb, so if any issue, lower case could be the culprit.