ABAP Function Module RV_DOCUMENT_PRINT_VIEW in SAP Smartforms
ABAP Function Module RV_DOCUMENT_PRINT_VIEW is used to get data for SAP sales order confirmation outputs created by SAP Smartform.
The vbdka parameter which is used to return document header data by ABAP function module RV_DOCUMENT_PRINT_VIEW can be used to print customer and address data for partner on the Order Confirmation smartform output.
The item details of the SAP sales order can be found in tvbdpa table.
ABAP function module rv_document_print_view returns the position data for all items in the sales order using the pos table parameter, tvbdpa here in this case.
If sales document number is passed to the function module RV_DOCUMENT_PRINT_VIEW, the order items are returned to the ABAP report in tvbdpa table (pos table parameter).
If partner function is passed to the function module rv_document_print_view using vbco3-parvw, the vbdka document header data is return in FM parameter kopf.
If Sold-to Party AG, Bill-to Party RE, Payer RG is passed as partner funtion then first customer name and address data will be of that sales order partner.
And the vbco3 structure fields whose name ends with "_WE" will return Ship-to Party partner data.
If Ship-to Party WE partner function is used in comwa parameter vbco3, the first customer data will be of Ship-to party partner.
On the other hand structure fields whose names ending with "_WE" will return empty data.
Here is a ABAP report partial codes for managing Smartform call and report data.
The NAST data is used to run the required ABAP function call RV_DOCUMENT_PRINT_VIEW.
ABAP developers can also test RV_DOCUMENT_PRINT_VIEW function module using SE37 as shown in below screenshot.