cancel
Showing results for 
Search instead for 
Did you mean: 

value of NETPR from wl_inforec is not getting copied in wl_contract.

Former Member
0 Kudos

 

Hi,

value of NETPR from wl_inforec is not getting copied in wl_contract.

Please help.

LOOP AT li_contract INTO wl_contract.

*Start Of Change Under CR55638 By ChandPra On 24/09/2012.

 

IF wl_contract-pstyp EQ 2.
READ TABLE li_inforec INTO wl_inforec WITH KEY infnr = wl_contract-infnr.

IF sy-subrc IS INITIAL.
MODIFY li_contract FROM wl_contract TRANSPORTING netpr.
wl_contract-waers = wl_inforec-waers.
wl_contract-netpr = wl_inforec-netpr.
wl_contract-peinh = wl_inforec-peinh.
wl_contract-bprme = wl_inforec-bprme.

ENDIF.
ENDIF

.

Thanx in advance.

Moderator message : Not enough re-search before posting, discussion locked.

Message was edited by: Vinod Kumar

Accepted Solutions (0)

Answers (3)

Answers (3)

iftah_peretz
Active Contributor
0 Kudos

Hi,

Put this Line: MODIFY li_contract FROM wl_contract TRANSPORTING netpr.

after this line:  wl_contract-netpr = wl_inforec-netpr.

So it will look like this:

LOOP AT li_contract INTO wl_contract.

*Start Of Change Under CR55638 By ChandPra On 24/09/2012.

IF wl_contract-pstyp EQ 2.

READ TABLE li_inforec INTO wl_inforec WITH KEY infnr = wl_contract-infnr.

IF sy-subrc IS INITIAL.

wl_contract-waers = wl_inforec-waers.

wl_contract-netpr = wl_inforec-netpr.

MODIFY li_contract FROM wl_contract TRANSPORTING netpr.

wl_contract-peinh = wl_inforec-peinh.

wl_contract-bprme = wl_inforec-bprme.

ENDIF.

ENDIF

.

former_member214878
Active Participant
0 Kudos

just looking at code, I think you should move inforec-netpr to contrct-netpr before Modify statement.

however, I suggest not to get spoon feeding here. This is not a question, it just need some to and fro ..trial and error on your problem....

Thanks and Regards,

Ravindra Sonar.

Former Member
0 Kudos

Hi,

It is getting copied for sure. But I think the execution is at wrong place.

I think pstyp is caharcter field.

Change the line

IF wl_contract-pstyp EQ 2.

to

IF wl_contract-pstyp EQ '2'.

and

Do This

*MODIFY li_contract FROM wl_contract TRANSPORTING netpr. "Delete this line

wl_contract-waers = wl_inforec-waers.
wl_contract-netpr = wl_inforec-netpr.
wl_contract-peinh = wl_inforec-peinh.
wl_contract-bprme = wl_inforec-bprme.

MODIFY li_contract FROM wl_contract TRANSPORTING netpr.

Since you are using transporting NETPR, only NETPR in table LI_CONTRACT internal table will be updated

Hope it helps.

Regards,

R