Hey gurus, I need your help.
I have a module pool with screen 100, see the following image:
And I need to fill the table name and simulate the button press with a parameter transaction.
I made the following parameter transaction.
which fill the table name, but I can't simulate the button press.
So I was thinking about another Default Value on the parameter transaction ZBRLIBAUTDIS and I would write in to the code an IF statement and trigger the PAI, but I can't because I can only set those fields which are on the screen. I tried to make a hidden field on the screen, but when I put the field active = 0 it's not possible to fill it, the only way to fill it is when the field is not hidden.
1. Is it possible somehow to make a not visible field on the screen which I can fill with the parameter transaction?
Another idea was to use the transaction name to decide which button force to press.
So in the PBO I got the last 3 characters from the transaction name with the following code:
DATA leng TYPE i.
leng = strlen( sy-tcode ) - 3.
SHIFT sy-tcode CIRCULAR BY leng PLACES.
IF sy-tcode(3) EQ 'DIS' OR
sy-tcode(3) EQ 'EDI' OR
sy-tcode(3) EQ 'CRT'.
scr_mode = sy-tcode(3).
I set the scr_mode, what normally do the button press, so the job is done, my only work here is to trigger the PAI now and the program do the rest of the job, but it's not working properly.
I forced the PAI with SUPPRESS DIALOG statement, what forced the PAI, but in this case the IF_TABLE_NAME wasn't fill. I think it is because the parameter transaction fill the field just on the end of the PBO and the SUPPRESS DIALOG is automatically jump to the PAI, so the parameter transaction can't fill the IF_TABLE_NAME.
So I tried to force the PAI with CALL METHOD cl_gui_cfw=>flush, which doesn't work with the above parameter transaction. It works only with this kind of parameter transaction.
Which I would not mind, but in this case the sy-tcode contains the ZBRLIB00S and not the ZBRLIBAUTDIS. So I failed again.
2. So why the FLUSH doesn't work when I'm setting the program and the screen number to the parameter transaction?
3. Is there some different way to trigger the PAI, which let the PBO finish and it's working if the first parameter transaction?
4. Is there somehow possible to write a code somewhere between the PBO and PAI?
5. Do you know some elegant solution to my problem?
P.S. I know it is possible to solve it when I rename the dialog transaction, but I want to do it for many various table names and for all buttons, so I should made 2 transactions (dialog and parameter) for every variant, and it is not really elegant solution.
If you need more information, just let me know.
Regards,
Robert