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

Logic needed . Please help me.

Former Member
0 Likes
490

I need to get PO number to pass into one of the variable.

To achieve this (as per spec given)I need to do below:

<b>get record REGUP-BELNR (if document >= XXXXXXXXXX or <= XXXXXXXXXX) then invoice is associated to PO.

Store values REGUP-BUKRS, REGUP-BELNR, and REGUP-GJAHR, go to table BKPF and populate fields with stored values (BUKRS, BELNR, GJAHR). Store value BKPF-AWKEY (first 10 digits is BELNR and last 4 is GJAHR), go to table RSEG and populate fields with stored values (BELNR, GJAHR). Store value EBELN and populate IDOC record.</b>

<b>get record REGUP-BELNR (if document >= XXXXXXXXXX or <= XXXXXXXXXX) then invoice is associated to PO.</b>

I have seen in DB TABLES,for the above I have multiple records getting selected.

Based on the above selected REGUP-BUKRS, REGUP-BELNR, and REGUP-GJAHR, am selecting from BKPF table ....so here also again I have multpiple records.

After that RSEG also having multiple records.

How to get single PO out of the above specs ?PLEASE SUGGEST ME ...

I need to get PO number to pass into one of the variable.

To achieve this (as per spec given)I need to do below:

<b>get record REGUP-BELNR (if document >= XXXXXXXXXX or <= XXXXXXXXXX) then invoice is associated to PO.

Store values REGUP-BUKRS, REGUP-BELNR, and REGUP-GJAHR, go to table BKPF and populate fields with stored values (BUKRS, BELNR, GJAHR). Store value BKPF-AWKEY (first 10 digits is BELNR and last 4 is GJAHR), go to table RSEG and populate fields with stored values (BELNR, GJAHR). Store value EBELN and populate IDOC record.</b>

<b>get record REGUP-BELNR (if document >= XXXXXXXXXX or <= XXXXXXXXXX) then invoice is associated to PO.</b>

I have seen in DB TABLES,for the above I have multiple records getting selected.

Based on the above selected REGUP-BUKRS, REGUP-BELNR, and REGUP-GJAHR, am selecting from BKPF table ....so here also again I have multpiple records.

After that RSEG also having multiple records.

How to get single PO out of the above specs ?PLEASE SUGGEST ME ...

2 REPLIES 2
Read only

Former Member
0 Likes
453

Hi Sam,

You can use <b>Sort</b> statement followed by <b>Delete adjacent duplicates</b> to get single PO.

Regards,

Raj

Read only

Former Member
0 Likes
453

Hi,

Use select single to get single PO

Regards,

Amole