‎2010 Nov 23 6:08 AM
Hi,
I am using sd_salesdocument_create to create Credit notes,based on the requirement I need the billing block field (FAKSK)
to be empty,or initial. If I pass space into the billing block field in the header it is by default taking the value as 08.
I have also tried to use an implicit enhancement in the BAPI - SD_SALESDOCUMENT_CREATE .
s_header-bill_block = SPACE.
CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'
EXPORTING
* SALESDOCUMENT =
sales_header_in = s_header
sales_header_inx = s_headerx
* SENDER =
* BINARY_RELATIONSHIPTYPE = ' '
* INT_NUMBER_ASSIGNMENT = ' '
* BEHAVE_WHEN_ERROR = ' '
* LOGIC_SWITCH = ' '
business_object = 'BUS2094'
* TESTRUN =
convert_parvw_auart = 'X'
STATUS_BUFFER_REFRESH = 'X'
IMPORTING
salesdocument_ex = v_cmr
* SALES_HEADER_OUT =
* SALES_HEADER_STATUS =
TABLES
return = i_return
sales_items_in = i_item
sales_items_inx = i_itemx
sales_partners = i_partner
* SALES_SCHEDULES_IN =
* SALES_SCHEDULES_INX =
sales_conditions_in = i_cond
sales_conditions_inx = i_condx
* SALES_CFGS_REF =
* SALES_CFGS_INST =
* SALES_CFGS_PART_OF =
* SALES_CFGS_VALUE =
* SALES_CFGS_BLOB =
* SALES_CFGS_VK =
* SALES_CFGS_REFINST =
* SALES_CCARD =
* SALES_TEXT =
* SALES_KEYS =
* SALES_CONTRACT_IN =
* SALES_CONTRACT_INX =
* EXTENSIONIN =
* PARTNERADDRESSES =
* SALES_SCHED_CONF_IN =
* ITEMS_EX =
* SCHEDULE_EX =
* BUSINESS_EX =
* INCOMPLETE_LOG =
* EXTENSIONEX =
* CONDITIONS_EX =
* PARTNERS_EX =
* TEXTHEADERS_EX =
* TEXTLINES_EX =
* BATCH_CHARC =
* CAMPAIGN_ASGN =
* CONDITIONS_KONV_EX =
.
...
Regards,
Rahul Tripathi
‎2010 Nov 23 6:13 AM
Are you passing 'X' to structure field SALES_HEADER_INX-BILL_BLOCK while calling BAPI ?
‎2010 Nov 23 6:13 AM
Are you passing 'X' to structure field SALES_HEADER_INX-BILL_BLOCK while calling BAPI ?
‎2010 Nov 23 6:17 AM
Yes, I am dam doing that also. I want to know the table/sturcture that is passed by the bapi SD_SALESDOCUMENT_CREATE
So that I can check it manually and clear the field in the enhancment Point.
‎2010 Nov 23 6:31 AM
Are you creating a credit Note OR Credit Memo Request? The Function module mentioned by you is used to create credit memo request (Sales document). Check whether any user exits are activated which overwrites the value passed through BAPI. Otherwise you don't need any enhancements other than values passed in structure field BILL_BLOCK in bapi.
‎2010 Nov 23 6:49 AM
I am creating a Credit memo Request, and there are no Enhancments,which can possibly overwrite the Billing block Feild.
However in the BAPI SD_SALESDOCUMENT_CREATE the function module 'SD_SALES_DOCU_MAINTAIN'
returns da_vbak,which populates the bliing block field as '08'.However, the structure e_vbakkom has the billing nlock field as initial.
call function 'SD_SALES_DOCU_MAINTAIN'
exporting
i_vbakkom = e_vbakkom
i_vbakkomx = e_vbakkomx
i_vbakkom_ref = e_vbakkom_ref
i_posnr = int_number_assignment
i_bwe = behave_when_error
i_logic_switch = logic_switch
simulation = testrun
i_call_bapi = charx
status_buffer_refresh = status_buffer_refresh
importing
* return = return
e_vbak = da_vbak
e_vbuk = da_vbuk
tables
return = return
ix_vbapkom = ex_vbapkom
ix_vbapkomx = ex_vbapkomx
ix_vbpakom = ex_vbpakom
ix_vbepkom = ex_vbepkom
ix_vbepkomx = ex_vbepkomx
ix_konvkom = ex_konvkom
ix_konvkomx = ex_konvkomx
ix_komfkzm = ex_komfkzm
sales_cfgs_ref = sales_cfgs_ref
sales_cfgs_inst = sales_cfgs_inst
sales_cfgs_part_of = sales_cfgs_part_of
sales_cfgs_value = sales_cfgs_value
sales_cfgs_blob = sales_cfgs_blob
sales_cfgs_vk = sales_cfgs_vk
sales_cfgs_refinst = sales_cfgs_refinst
ix_text_header = ex_text_header
ix_text_item = ex_text_item
key_table = sales_keys
vbuvkom_out = ex_vbuvkom_out
ex_vbkd = e_vbkd
ex_vbap = e_vbap
ex_vbep = e_vbep
ex_konv = e_konv
ix_bapiaddr1 = partneraddresses
ix_atpcs_ret = lt_atpcs_ret
ix_mdve = lt_mdve
ix_atpterm = lt_atpterm
batch_charc = batch_charc
ex_vbpa = e_vbpa
ex_theadvb = e_theadvb
ex_bapitextli = textlines_ex.
‎2010 Nov 23 8:47 AM
The value passed in BAPI is replace in the include "FV45KFAK_VBAK_BEARBEITEN_VORBE" (Which is called from function module SD_SALES_HEADER_MAINTAIN line number 110), where the default configuration value of the document type is copied from config table TVAK. (See line number 26 of the include).
Instead of creating enhancement point to modify this, you can use the userexit "USEREXIT_MOVE_FIELD_TO_VBAK" of "MV45AFZZ" (this is called after the include mentioned above) , where you can modify the structure field VBAK-FAKSK as per your requirement.
‎2010 Nov 23 9:36 AM
Thanks for the reply. I am checking the billing Block Type as '08',and then changing it to space.