Application Development 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: 

How to capture the ok-code from xd01 to my program

Former Member
0 Kudos

Hi All,

I have a big problem. I have created a t-code zxd01 and my program zsapmf02d. In my t-code, in my first screen it looks like xd01 first screen and extra some custom fields.

In my first screen it has buttons, if they click on "create" button on 1st screen i am calling "Call transaction xd01 and skip first screen". Its calling xd01 2nd screen and remaining things xd01 functionality. but when user presses any ok-code, its coming back to my program. I don't want do this thing for some ok-codes like "enter". How to do this? I am thinking if i capture the ok-code from xd01 and when its coming back to my progarm, i can tell it behave differently.

How to capture it? Is there any userexits to capture the ok-code, from there using export and import?

Its a high priority issue. Please help me.

Thanks

5 REPLIES 5

Former Member
0 Kudos

Why did you copy it, if you are calling XD01 internally?

Please close the other post which is a duplicate of this.

0 Kudos

You flow is probably like this.

call screen xxx. xxx is similar to XD01 initial screen with additional fields. User presses the 'Create' button. In your PAI user command logic of xxx screen, you are filling in the BDC data(or setting the parameters) for the initial screen of XD01 and then doing a call transaction skipping the initial screen. At this point, the control is out of your hands. You cannot trap the XD01 okcodes here. Now the transaction is completed and it comes back to your PAI logic after the CALL TRANSACTION statement. If you don't want this, you can try SET SCREEN 0 and LEAVE TO TRANSACTION 'XD01' AND SKIP INITIAL SCREEN.

0 Kudos

Hi Srinivas,

Flow is same like this what you mentioned, its calling after xd01, coming back to PAI logic in my screen. User enters some information in my first screen. I am passing that data using BDC call transaction xd01 and skip first screen to the xd01 2nd screen, name,address etc.

If i use leave transaction xd01 and skip initila screen, how can i pass this information from my first screen name,address to 2nd screen of xd01.

Thanks for your help.

0 Kudos

Ok, so if you are using BDC data and calling the transaction, then the control returns to you in the PAI to the next line after the call. There you can read the bdc messages returned from the call and depending on it, you can either SET SCREEN 0. LEAVE SCREEN. or do something else.

But one thing to remember is you cannot go back and forth. If the user wants to change mind and go back to initial screen to change some data by clicking the BACK arrow, you have to do the call again by filling the BDC data again from scratch.

0 Kudos

There are parameter IDs to many fields in the XD01 initial screen, set user entered values to the respective fields using SET parameter id statement in your Z program and try LEAVE to TRANSACTION.

Regards

Sridahr