‎2011 Jul 07 11:03 AM
reference note: 143580
VBAK (Append ZZFIELD1 CHAR4)
VBAKKOZ (Append ZZFIELD1 CHAR4)
VBAKKOZX (Append ZZFIELD1 CHAR1)
BAPE_VBAK (Append ZZFIELD1 CHAR4)
BAPE_VBAKX (Append ZZFIELD1 CHAR1)
DATA: WA_EXTENSION TYPE BAPIPAREX,
WA_BAPE_VBAK TYPE BAPE_VBAK,
WA_BAPE_VBAKX TYPE BAPE_VBAKX.
WA_BAPE_VBAK-ZZFIELD1 = 'ABCD'.
WA_BAPE_VBAKX-ZZFIELD1 = 'X'.
MOVE 'BAPE_VBAK' TO WA_EXTENSION-STRUCTURE.
MOVE WA_BAPE_VBAK TO WA_EXTENSION-VALUEPART1.
APPEND WA_EXTENSION TO EXTENSIONIN.
CLEAR WA_EXTENSION.
MOVE 'BAPE_VBAKX' TO WA_EXTENSION-STRUCTURE.
MOVE WA_BAPE_VBAKX TO WA_EXTENSION-VALUEPART1.
APPEND WA_EXTENSION TO EXTENSIONIN.Finally, Sales Order is created, but does not update ZZFIELD1.
what's problem?
‎2011 Jul 07 11:36 AM
Hi Cpliu,
I did this at item level.
1) VBAP: In your append structure you specify your ZZFIELD with the data type as needed
2) BAPE_VBAP: In the append structure here also add the ZZFIELD with the data type as needed with limitations. No decimals. Try and stick to char characters
3) BAPE_VBAPX: In the append structure add the field ZZFIELD of type BAPIUPDATE
(NOTE: (2) and (3) must have the same number of fields in the same order)
4) VBAPKOZ: In the append structure here also add the ZZFIELD with the data type as needed with limitations. No decimals. Try and stick to char characters
5) VBAPKOZX: In the append structure add the field ZZFIELD of type BAPIUPDATE
(4) and (5) must have the same number of fields in the same order)
Similarly do for VBAK, BAPE_VBAK, BAPE_VBAKX, VBAKKOZ and VBAKKOZX.
Check this and see.
Regards,
Madhu.
‎2011 Jul 07 11:41 AM
Thanks reply.
I haven't try to update VBAP,
(VBAKKOZX and BAPE_VBAKX) ZZFIELD1 data type was changed to BAPIUPDATE.
It's also not work.
‎2011 Jul 07 11:51 AM
Hi,
That is fine .Try the same way to update vbak.
Regards,
Madhu.
‎2011 Jul 07 2:53 PM
Hi
Madhu is right. See SAP Note 143580 - Information on SD BAPIs and customer enhancement concept
This IDOC call the function module SD_SALESDOCUMENT_CREATE. In the subroutine
perform ms_move_extensionin tables extensionin
sales_items_in
sales_schedules_in
using
sales_header_in.
In this subroutine, in this coding and so on, debug it, with the aim to know what happens.
LOOP AT extensionin.
CASE extensionin-structure.
* BAPI-Schnittstelle für Kundenerweiterungen zur Tabelle VBAK
WHEN 'BAPE_VBAK'.
call method cl_abap_container_utilities=>read_container_c
exporting
im_container = extensionin+lv_length
importing
ex_value = wa_bape_vbak
exceptions
illegal_parameter_type = 1
others = 2.
CATCH SYSTEM-EXCEPTIONS conversion_errors = 1. "#EC *
MOVE-CORRESPONDING wa_bape_vbak TO e_vbakkom.
ENDCATCH.
* BAPI-Ankreuzleiste für Kundenerweiterungen zur Tabelle VBAK
WHEN 'BAPE_VBAKX'.
MOVE extensionin+lv_length TO wa_bape_vbakx.
CATCH SYSTEM-EXCEPTIONS conversion_errors = 1. "#EC *
MOVE-CORRESPONDING wa_bape_vbakx TO e_vbakkomx.
ENDCATCH.
.............
ie: check if data is trasfered to E_VBAKKOM as note says in point 8
I hope this helps you
Regards
Eduardo
‎2011 Jul 07 3:10 PM
Thanks reply.
I have been debug, the output value is:
E_VBAKKOM-ZZFIELD1 = 'ABCD'.
‎2011 Jul 07 3:31 PM
perform map_vbak_to_bapisdhd tables return
extensionex
using da_vbak
changing sales_header_out.* fill the extension structure for the header bapi
if da_extension_needed = charx.
move-corresponding da_vbak to da_bape_vbak.
catch system-exceptions conversion_errors = 1.
* Belegnummer übernehmen
move da_vbak-vbeln to da_bape_vbak-vbeln.
* Strukturnamen setzen
move 'BAPE_VBAK' to da_parex-structure.
* Daten übertragen
move da_bape_vbak to da_parex-values.
move da_parex to ch_parex.
endcatch.
* Erweiterungsstruktur aufbauen
append ch_parex.
endif.Finally, in table "ch_parex", output is
CH_PAREX-STRUCTURE = 'BAPE_VBAK'
CH_PAREX-VALUEPART1 = '1234567890ABCD'
at this line, it seems no problem..?
‎2011 Jul 08 8:52 AM
Thanks all. problem is solved.
Finally, I found this user exit effect result.
USEREXIT_SAVE_DOCUMENT_PREPARE