Skip to Content
author's profile photo Former Member
Former Member


Hi I am using the BAPI sd_salesdocument_create to create sales orders and need to pass the field Tax Number 1 (STCD1) for the case of a customer CPD. I'm using the table EXTENSIONIN as follows but not recorded the field.


EXTENSIONIN-VALUEPART1 = '         000000AG10406707933'


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Dec 21, 2011 at 02:30 AM

    The coding for extension to SD_SALESDOCUMENT_CREATE goes like below. Here, I am populating a new field VBAK-ZZ_FIELD with a value. Later I will pass EXTENSIONIN table to SD_SALESDOCUMENT_CREATE.

    You need to do similar coding for the field STCD1 for your structure.

    DATA: extensionin LIKE bapiparex OCCURS 0 WITH HEADER LINE.
    DATA: ls_bape_vbak            LIKE bape_vbak,
          ls_bape_vbakx           LIKE bape_vbakx.
    CLEAR extensionin.
    MOVE 'BAPE_VBAK'           TO extensionin-structure.
    ls_bape_vbak-zz_field = 'Value'.
    MOVE ls_bape_vbak          TO extensionin-valuepart1.
    APPEND extensionin.
    CLEAR extensionin.
    MOVE 'BAPE_VBAKX'          TO extensionin-structure.
    MOVE 'X'                   TO ls_bape_vbakx-zz_field.
    MOVE ls_bape_vbakx         TO extensionin-valuepart1.
    APPEND extensionin.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 21, 2011 at 03:45 AM


    This is discussed no of times in the forum.Please go through this note 143580 .It is in detail.



    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      The Note 143580 is for enhancement customer fields, in my case the field Tax Number 1 (SCTD1) exists in the CPD customer screen when registering a sales order. The Tax Number 1 field is stored in the table VBPA3, as I can record this field by SD_SALESDOCUMENT_CREATE BAPI?


  • author's profile photo Former Member
    Former Member
    Posted on Dec 10, 2013 at 05:26 PM

    Daniel, i have a similar problem, using the bapi.: BAPI_SALESORDER_CREATEFROMDAT2

    I use the EXTENSIONIN table as follows, but the data for the fields that we need are empty.

    This is my code to fill the EXTENSIONIN table:

    Do you see something wrong?

    "dato de CPD - si corresponde.

    tBapiEXT-structure = 'VBPA3KOM'.

    clear tvbpa3kom.

    tvbpa3kom-stcd1 = lineas-stcd1.

    tvbpa3kom-stkzn = lineas-stkzn.

    MOVE tvbpa3kom TO tbapiEXT-valuepart1.

    append tBapiExt.

    clear tBapiExt.

    do yo resolve your problem?

    can you help me?

    best regards.


    Add a comment
    10|10000 characters needed characters exceeded

    • According to documentation parameter EXTENSIONIN can be used to fill fields that belong to tables: VBAK, VBAP, VBEP and VBKD - so it's no surprise that it's not working for other structures.

      But the workaround I used to fill fields of VBPA3 when calling SD order BAPIs is as follows:

      1. Before calling BAPI fm in your program: export your data - that you want to set in VBPA3 - to ABAP memory - with statement like: "export ... to memory id ..."

      2. Implement user exit USEREXIT_SAVE_DOCUMENT_PREPARE in include MV45AFZZ - or if you wish you can implement BAdI instead (BADI_SD_SALES, method SAVE_DOCUMENT_PREPARE).

      Within your code of the exit import the data you have exported before ("import ... from memory id ...") and use these data to fill required fields in internal table XVBPA - this internal table contains fields of VBPA3 among others.

      That's all.


Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.