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

PAI logic

Former Member
0 Likes
1,183

Hi experts,

I have a problem with the PAI. I debugged the program. It goes into modul m_modify. The value of the field1 is 2. I clear it and give the value 1. It is working fine, that's what I want. But after the program finishes the modul the value of the field becomes 2 again.

I don't know how could it happen if I previously cleared and gave a value to this field.

Here is my piece of code:

PROCESS AFTER INPUT.

FIELD v_modid MODULE m_modify ON REQUEST.

....

In the module I use the following commands:

clear: field1.

field1 = '1'.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,105

Hi,

I think in PBO you are setting the field value to 2 somewhere.

Because after PAI executes, it will execute the PBO again.

Thanks,

Srilakshmi.

8 REPLIES 8
Read only

Former Member
0 Likes
1,106

Hi,

I think in PBO you are setting the field value to 2 somewhere.

Because after PAI executes, it will execute the PBO again.

Thanks,

Srilakshmi.

Read only

0 Likes
1,105

No, it's not the case. The value changes back in the PAI module, right after it comes back from m_modify modul.

Read only

0 Likes
1,105

can u paste ur PBO code here.

Thanks,

Srilakshmi.

Read only

kheth
Active Participant
0 Likes
1,105

Change your coding like this:

PROCESS AFTER INPUT.

FIELD field1.
FIELD v_modid MODULE m_modify ON REQUEST.

Regards,

Karsten

Read only

0 Likes
1,105

Thank you very much!! It solved the problem. Could you explain it how it works?

Read only

kheth
Active Participant
0 Likes
1,105

In your module m_modify you change the value of field1 to '1', but for some reason

this abap field is set to the value of the screen field at a later point of time, it is

set back to '2' (I have to see the rest of your code to tell why).

By calling "FIELD field1" at first, you make sure that the transport of the screen field

to the abap field is done before your field value modification.

For more information about "Controlling the Data Transfer" you can check the

abap documentation [here|http://help.sap.com/saphelp_46c/helpdata/en/9f/dbabb035c111d1829f0000e829fbfe/frameset.htm].

Great I could help,

Karsten

Read only

Former Member
0 Likes
1,105

Thanks

Read only

Former Member
0 Likes
1,105

Thanks