02-19-2009 12:07 PM
Hi,
How can I remove the Billing Block in Billing plan for a single sales order? (header level)
What I need to remove/change to empty is the field FPLT-FAKSP (from Billing Plan tab) and not the FAKSK from table VBAK (in Billing Document tab).
Following example is only to remove the VBAK-FAKSK, but what i need is to remove the FPLT-FAKSP.
Please help.
Thanks
REPORT Z_BILLING_BLOCK.
PARAMETERS: p_vbeln TYPE vbak-vbeln.
DATA: l_header_inx TYPE bapisdh1x,
l_header_in TYPE bapisdh1.
DATA: lt_return TYPE STANDARD TABLE OF bapiret2.
update the flag.
l_header_inx-updateflag = 'U'.
l_header_inx-bill_block = 'X'. " Billing
l_header_in-bill_block = ''. " Remove Billing block.
Call the bapi.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = p_vbeln
order_header_in = l_header_in
order_header_inx = l_header_inx
TABLES
return = lt_return.
check for errors.
LOOP AT lt_return TRANSPORTING NO FIELDS WHERE type = 'A' OR type = 'E'.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
WRITE: / 'Error in updating'.
ELSE.
WRITE: / 'Billing block removed'.
COMMIT WORK AND WAIT.
ENDIF.
02-19-2009 12:09 PM
have a look
[Link|http://help.sap.com/printdocu/core/print46c/en/data/pdf/SDBIL/SDBIL2.pdf]
Regards
Shashi
02-19-2009 12:09 PM
02-19-2009 12:11 PM
02-19-2009 12:16 PM
Hi,
I don't want to use this is the sales order user-exit. What I really want is to have another different program running in background for example and removing this Billing Block (FPLT-FAKSP).
My code is only working for the billing block in Billing Document Tab and not for the one in Billing Plan.
Thanks a lot
Br
Anyone knows already a solution for this??
Edited by: Ninfx Ninfx on Feb 27, 2009 4:42 PM
03-10-2009 5:53 PM
03-10-2009 6:10 PM
03-10-2009 7:22 PM
I used this Function Module:
FUNCTION RV_SALES_DOCUMENT_UPDATE.
We can use these structures to update the billing block:
*" FXFPLA STRUCTURE FPLAVB OPTIONAL
*" FYFPLA STRUCTURE FPLAVB OPTIONAL
*" FXFPLT STRUCTURE FPLTVB OPTIONAL
*" FYFPLT STRUCTURE FPLTVB OPTIONAL
Regards
03-10-2009 8:51 PM