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: 

behavior of FM RV_DOCUMENT_PRINT_VIEW

Former Member
0 Kudos

Hi Experts,

Iam working on Smartform issue, which is related to Sales order.

Whenever a sales order is cretaed with particular line items and output is issued it will display my custom layout.

My problem is when the items are eneterd with the Required Quantity , and incase if stock doesnt exist, system will allocate avaialble quantity( which is less than required Quantity) as Confirmed Qunatity.

suppose for item 1 , user has assigned Required Quantity as 10, but if there is less stock ( say 8), then system automatically assigns 8 as Confirmed quantity.

In this scenaro each line item (for which the Confirmed qunatity and required quantities are diffrent) is being repeated twice.

Driver program being used is "/SMB40/RVADOR01" and the FM which is returning repeated items is RV_DOCUMENT_PRINT_VIEW .

in this FM , i found the below logic where it is appending 2 times if the confirmed qty and required qty are different.

if lvbdpa-kwmeng ne lvbdpa-kbmeng and

lvbdpa-etenr_da eq ' ' and

lvbdpa-posnr_neu eq charx and

lvbdpa-kbmeng ne 0.

t_pos-etenr_da = charx.

append t_pos. <----


1st append

t_pos-posnr_neu = ' '.

append t_pos.<----2nd append.

else.

........................

endif.

How to overcome this situiation where the items are getting repeated .

User doesnt want to see the rpeated line items in the output,

Helpful hints will be rewarded.

Regards,

Naveen

3 REPLIES 3

ravishankar_reddy2
Active Participant
0 Kudos

Hi,

use only one time

t_pos-etenr_da = charx.

t_pos-posnr_neu = ' '.

append t_pos

clear t_pos.

like this. I hope it may work.

regards,

ravi shankar reddy

carlos_zhang3
Participant
0 Kudos

Hi all ,

We are facing the same issue .

RV_DOCUMENT_PRINT_VIEW function is returning duplicates records due to the order qty and confirmed qty are not tally in sales order line item schedule line tab !!!

We are not allow to modify the standard sap program . So , the idea is to delete duplicates records in the return table !!


    DELETE ADJACENT DUPLICATES FROM tvbdpa COMPARING posnr.

Carlos

Edited by: Carlos Zhang on Dec 11, 2010 10:29 AM

0 Kudos

Hi Carlos,

You are right, it's related to not fully confirmed order quantity, however standard printing programs handle it using field POSNR_NEU from VBDPA structure.

E.g. RVADOR01 in subroutine item_print just ignores the row with POSNR_NEU initial.

Good reference are new printing programs SD_SDOC_PRINT01 for Adobe and SD_SDOC_PRINT02 for Smartforms - additional rows are being converted into row in schedule line

So, the best is to use standard printing programs and extend it using BAdI.

Regards,

Radek