Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Submit report and start pai function without user action

timo_ehl3
Participant
0 Likes
2,137

hi,

i'm submitting a report with a selection parameter.

In case of this parameter i wanna use some different fuctionality out of PAI.

in PBO of called report i'm catching parameter and in case of that im new ok_code depending on value with following snippet.

But unfortunately PAI is NOT triggered.

IF pa_ucomm IS NOT INITIAL.
    CALL METHOD cl_gui_cfw=>set_new_ok_code
      EXPORTING
        new_code = pa_ucomm.
*     CALL METHOD cl_gui_cfw=>flush. < NO EFFECT
*     CALL METHOD cl_gui_cfw=>update_view. <-NO Effect
*     SUPPRESS DIALOG. <- NO EFFECT
     clear: pa_ucomm, l_ucomm_zeitraum.
   endif.

Any idea, any workarround?

thank you in advance,

t

13 REPLIES 13
Read only

Former Member
0 Likes
1,592

Hi Timo,

Did you use this code under 'at selection screen'? If it doesn't work, you can write this code under 'at selection-screen output' and create a button to catch that parameter.(ie catches when user pushes the button)

If you can tell more about whatever you want to do I can gladly try to help more.

Regards,

Kerim.

Read only

0 Likes
1,592

Hi Kerim,

thanx a lot.

I'm using this code in PBO Module of "called report". Caller (pa_ucomm is cleared) and called program (pa_ucomm is filled by button) is the same. But i guess it's not the problem.

it's bit tricky to describe, but at least its simple.

1. I'm using z report with a lot of pushbuttons f.e. to change timeperiods or parameters for data selection.

2. one of the buttons is submitting the same report (submitting itself with no return) with different sel-screen parameters

up to now everything works fine standard pbo is called and dialogof new submitted report appears with correct refreshed data.

now i want to submit this report again but with specific user action. So i decided to create an additional selscreen parameter wit no display. <-pa_ucomm.

In pa_ucomm im saving the action a user did in calling programm by button f.e..

So...after submitting the report im catching it in pbo and now i need to have functionality of PAI-"Step" to select depending data.

That's why i tried to set PAI UCOMM (by using cl_gui_cfw=>set_new_ok_code

) in PBO to this new value (pa_ucomm) and i expectet that PAI is triggered.

But unfortunately not,

Regards,

T

Read only

surajarafath
Contributor
0 Likes
1,592

Have you tried SET USER-COMMAND 'XXXX'.

Read only

0 Likes
1,592

Hi,

thanx.

I just tried. No PAI is triggered

Read only

0 Likes
1,592

Hi Timo,

i think fcodes can be triggered automatically in a report but i'm afraid, this may not be the case with module pools, so without user interaction it may not be poosible, can u explain your requierement in detail may the community could come up with alternatives, but for triggering PAI i'm afraid may not be possible,

i would still be watching the thread, because it would be interesting to know if that could be done and somebody comes up with a solution.

Regards,

Kartik

Read only

0 Likes
1,592

Then try this code to force PBO/PAI

CALL METHOD cl_gui_cfw=>set_new_ok_code
      EXPORTING
        new_code = 'DUMMY'.

Read only

0 Likes
1,592

that was my question - regarding my first post

Read only

0 Likes
1,592

If i understand you correctly, In PBO you are calling a report which will fiill your ucomm (pa_ucomm) and after this you need to trigger PAI for this particular pa_ucomm.

can you try that coding in PBO itself? im not tried, i am just suggesting..

Read only

0 Likes
1,592

Hi..thank you.

No that was not my approach.

I'm calling (via Submit) a report in PAI (as usual). After the user hits a button i'm catching sy-ucomm and in case..endcase im doing the action (setting a special selscreen parameter and submitting).

Then in PBO of the called report im checking if selscreenparameter is filled. if true...then set_new_ok_code

1. programm X calls screen y in pbo of screen y, selscreen parameter of programm x is empty

2. programm X is setting selscreen, submitting programm x

3. in pbo of programm x i'm checking in pbo if selscreen is set

4. if true...do special pai coding (and that's the question...how to trigger)

regards

Read only

0 Likes
1,592

> 3. in pbo of programm x i'm checking in pbo if selscreen is set

==> dont check in PBO. just keep suppress dialogue. this will call PAI of x

> 4. if true...do special pai coding (and that's the question...how to trigger)

==>now PAI is triggered.. here check the value of what ever field and what ever core you want to do

> regards

Read only

Former Member
0 Likes
1,592

can u try with

SET USER-COMMAND

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,592

Use [SUPPRESS DIALOG|http://help.sap.com/abapdocu_70/en/ABAPSUPPRESS.htm] to trigger PAI from PBO and don't use cl_gui_cfw=>set_new_ok_code.

* PBO (end of)
IF pa_ucomm IS NOT INITIAL.
  SUPPRESS DIALOG. 
ENDIF.

* PAI (start of)
IF pa_ucomm IS NOT INITIAL.
  ok_code = pa_ucomm.
  clear pa_ucomm.
ENDIF.

If you actually want to use the set_new_ok_code method, check the return code. (look for values :cl_gui_cfw=>rc_wrong_state "The method was not called from the handler method of a system event." and

cl_gui_cfw=>rc_invalid : "The OK_CODE that you set is invalid. ")

Regards,

Raymond

Read only

Former Member
0 Likes
1,592

program X calls screen Y whose PAI you want to execute without PBO of Y.

so in PBO of Y, you need to write the "SUPPRESS DIALOG". and this works.

but one more thing, it acts like you have pressed enter on the keyboard. so the focde or sy-ucomm becomes the fcode set for this in the gui status, so adjust your code accordingly..

Edited by: Soumyaprakash Mishra on Jan 27, 2012 12:01 AM