Handling Extension Structure using BAPI in Unicode environment

Hi,
I am using the BAPI BAPI_OUTB_DELIVERY_CREATE_SLS  to create Outbound Delivery.
We have a nested include structure in LIPS which has mixed field type.
Since BAPIPAREX is used to pass the value for Extension fileds, I have problem with the Unicode environment. Packed fields are filled with '#''s, Can someone who come cross similar issue could help me please.

In BAPI the structure I want to populate : EXTENSION_IN
The custom append structure is in: LIPS
Append structure name: OILLIPS
(Below are Some fields in structure)
.INCLUDE     OID_EX          0
OID_EXTBOL       OID_EXTBOL     CHAR     16
OID_MISCDL       OID_MISCDL     CHAR     16
.APPEND       YOID_EX          0
YYARC       YYVARC                         CHAR                           21
YYLRN       YYVLRN     CHAR     22
YYEPC       YYVEPC     CHAR     4
YY_NOMNR       OIJ_NOMNR     CHAR     20
YY_NOMTYP     OIJ_NOMTYP     CHAR     4
YY_PASSTHROUGH     YYMPASSTHROUGH     CHAR     1
YY_PARCEL     YYMPARCEL     NUMC     3
YY_TRD_PARCEL     YYMTRD_PARCEL     NUMC     3
YY_LD_LOCID     YYMLD_LOCID     CHAR     10
YY_DC_LOCID     YYMDC_LOCID     CHAR     10
YY_NOM_TSYST     OIJ_TSYST     CHAR     10
YY_NOM_CREYEAR     YYMCREYEAR     NUMC     4
YY_NOM_CYCLE     OIJ_CYCLE     CHAR     10
.INCLUDE     OIC_PIPE          0
I tried using field-symbols and casting and also CALL METHOD cl_abap_container_utilities=>fill_container_c. Both are giving only hexadecimal values and then when tired to assign this hexadecimals values to character field i am getting "#"'s.
This morning, when I tired by defining a structure with field correspond to this append structure as character field with length corresponding to each field and then assign individual field one by one it takes the value. There should be an efficient way of handling this scenario.

Similar Messages

  • Extension Structure in BAPI BAPI_FIXEDASSET_CREATE1

    Hi Experts,
    I have added a Z field in ANLZ table . In my Z program i am using BAPI_FIXEDASSET_CREATE1 for asset creation.
    Now i need to pass data to Z field in ANLZ table using above BAPI.In above mentioned BAPI in extension structure i can only find BAPI_TE_ANLU and nothing like BAPI_TE_ANLZ so how can i use extension structure for updation of Z field in ANLZ.
    Please suggest.
    Regards,
    Kaustubh.

    Hi
    Jusat try wid dis structure  BAPI_TE_ANLU just add your zeee fields in this structure and just paas the values in the *BAPIPAREX * , with  Enhancement AIST0002
    contains function module EXIT_SAPL1022_001 as a component in which user fields can be implemented.
    Hope it is helpful .
    Regards
    Swapnil kamble

  • Structure extension in satndard bapi for sales order

    hi all,
    i have a requirement where i have to create sales order with some custom fields on to the screen.
    how can i use the extension structure  in bapi 'BAPI_SALESORDER_CREATEFROMDAT2' .
    to upload the data of the custom fields.
    regards
    vijay

    Hi Vijay sharma,
    Please check these links
    http://help.sap.com/saphelp_46c/helpdata/en/c3/40999d8b8911d396b70004ac96334b/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/4099a68b8911d396b70004ac96334b/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/4099ac8b8911d396b70004ac96334b/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/3e/0e1089c24611d1ad09080009b0fb56/content.htm
    Example for BAPI
    http://www.sapmaterial.com/bapi_example.html
    Hope this helps...
    Best regards,
    raam

  • Getting Error Messages in UNICODE environment...

    Hi,
    I am facing problem, while getting few error message when i tried to run query using OCCI in UNICODE environment.
    for eg.
    For error number ORA-32108
    i am getting error message as
    剏ⵁ㈳〱㨸洠硡挠汯浵牯瀠牡浡瑥牥猠穩⁥潮⁴灳捥晩敩੤:
    but in same environment for error number ORA-01017:
    i am getting error message as "invalid username/password; logon denied".
    Code i have used to get error message is as follows
    String type here used is unicoded string.
    String strErrorCode(ex.getErrorCode());
    String strErrorMsg(ex.getUStringMessage().c_str());
    Please let me know what i am doing wrong over here.
    or is it a known behavior?
    Thanks in Advance.

    you need to identify each cell in the formula.  this is because each has a different 'path'.  here is what you need:
    Sum(form1.#subform[0].Table1.Row2.TotalAllowable.form1.#subform[0].Table1.Row3.TotalAllowa bleform1.#subform[0].Table1.Row4.TotalAllowableform1.#subform[0].Table1.Row5.TotalAllowabl eform1.#subform[0].Table1.Row6.TotalAllowableform1.#subform[0].Table1.Row7.TotalAllowablef orm1.#subform[0].Table1.Row8.TotalAllowableform1.#subform[0].Table1.Row9TotalAllowableform 1.#subform[0].Table1.Row10.TotalAllowableform1.#subform[0].Table1.Row11TotalAllowableform1 .#subform[0].Table1.Row12TotalAllowableform1.#subform[0].Table1.Row13.TotalAllowableform1. #subform[0].Table1.Row14.TotalAllowableform1.#subform[0].Table1.Row15.TotalAllowable.form1 .#subform[0].Table1.Row16.TotalAllowable)
    I know it looks horrible, but notice that each one has a different row number.  That is why you keep getting the error message.  Also, rename your row 16[1] or note the last entry of your calculation script should be row16[0].
    have fun.
    rpeterson

  • How to handle  user exits while using BAPI

    HI experts can any one help me on how to handle user exits while using BAPI. Do we need to handle it explicitly or standard  BAPI will take care of it??.
    Regards,
    Hari Krishna

    If you have added some fields using append structures for screen enhancements, then you have to use appropriate user exits to fill these data while calling BAPI.  Some BAPIs have EXTENSION structures to fill the custom data which can be processed using user exists or enhancements.
    Regards
    Vinod

  • Extension structure for a bapi to create project definition and wbs element

    Hi,
    is there a bapi that have an extension structure for custom fields, that can be used to create a project with wbs elements.
    thanks for your help.

    i yhink BAPI_PROJECT_MAINTAIN  dont have extension structure, so i cant use it because i have custom fields.
    BAPI_BUS2054_CREATE_MULTI seems meet my requirement because it has extension structure,

  • How to use Extension parameter in BAPI

    Hi,
    Can anyone provide any clue about how to use the EXTENSION paramenters in BAPI? Thanks.
    Regards,
    Chris

    Hi,
    just check this thread you can get some idea how to use extension in BAPI.
    BAPI_ACC_DOCUMENT_POST  (EXTENSION)
    Regards
    Vijay

  • Use of structure in handling repetitve structure

    Hi!,
    I have a problem with read/modify the repetitve structure. I feel that to read/modify the repetitve structure I cant use just a new structure as the structure will hold only one record. To hold more than one record I will have to use a stru/table. how should I proceed. For example, if my infotyp is IT0812 for KR, and I will have handle the structure HCMT_BSP_PA_KR_R0812 and repetitive structure HCMT_BSP_PA_KR_R0812_LIN_A, ie to read/modify the field from both rep as well as non rep struc.
    -- R C Naveen

    I guess you can use multiple performs and one form routine :
    see the simple example :
    PERFORM write_2_server TABLES hire_emp_tab.
    PERFORM write_2_server TABLES entrance_tab.
    PERFORM write_2_server TABLES integration_tab.
    PERFORM write_2_server TABLES duty_tab .
    PERFORM write_2_server TABLES type_emp_tab.
    PERFORM write_2_server TABLES job_part_tab .
    PERFORM write_2_server TABLES free_days_tab.
    PERFORM write_2_server TABLES status_tab.
    PERFORM write_2_server TABLES bank_detailes_tab.
    FORM write_2_server TABLES p_tab_data.
    FIELD-SYMBOLS: <wa> TYPE ANY.
    " MOVE 'D:_pa_test_mmsk_pa1.txt' TO adress.
    OPEN DATASET adress IN TEXT MODE
    ENCODING DEFAULT FOR OUTPUT.
    IF sy-subrc = 0.
    no_file = ' '.
    LOOP AT p_tab_data ASSIGNING <wa>.
    TRANSFER <wa> TO adress.
    ENDLOOP.
    CLOSE DATASET adress.
    ELSE.
    no_file = 'X'.
    ENDIF.
    endform.
    Thanks
    Seshu

  • Event Handling for tree structure using "CL_GUI_ALV_TREE_SIMPLE"

    Hi,
    I have created a tree structure using class CL_GUI_ALV_TREE_SIMPLE.
    Now I wanted to insert a check and give message when the user opens the last node in my structure.
    I checked the events available in the class , but there in none which gets trigered when we try to open a node.
    Please guide me with this scenario.
    Thanks & Regards,
    Omkar M.

    Hello Omkar
    The solution is somewhat odd but apparently works. As sample report please check BCALV_TREE_SIMPLE_DEMO.
    Copy this report and make the following changes:
    class lcl_tree_event_receiver definition.
      public section.
        methods:
        on_expand_no_children " new event handler method
          for event expand_no_children of cl_gui_column_tree
            importing NODE_KEY,  " class = CL_GUI_COLUMN_TREE !!!
        on_add_hierarchy_node
                  for event on_add_hierarchy_node of cl_gui_alv_tree_simple
                        importing grouplevel
                                  index_outtab.
    endclass.
    CLASS lcl_tree_event_receiver IMPLEMENTATION.
      METHOD on_expand_no_children.
        BREAK-POINT.
      ENDMETHOD.                    "on_expand_no_children
    FORM register_events.
    * define the events which will be passed to the backend
      DATA: lt_events TYPE cntl_simple_events,
            l_event TYPE cntl_simple_event.
    * define the events which will be passed to the backend
      l_event-eventid = cl_gui_column_tree=>eventid_node_context_menu_req.
      APPEND l_event TO lt_events.
      l_event-eventid = cl_gui_column_tree=>eventid_expand_no_children.
      APPEND l_event TO lt_events.
      CALL METHOD tree1->set_registered_events
        EXPORTING
          events                    = lt_events
        EXCEPTIONS
          cntl_error                = 1
          cntl_system_error         = 2
          illegal_event_combination = 3.
    * set Handler
      DATA: l_event_receiver TYPE REF TO lcl_tree_event_receiver.
      CREATE OBJECT l_event_receiver.
      SET HANDLER l_event_receiver->on_add_hierarchy_node
                                                            FOR tree1.  " CL_GUI_ALV_TREE_SIMPLE
      SET HANDLER l_event_receiver->on_expand_no_children
                                              FOR ALL INSTANCES. " CL_GUI_COLUMN_TREE !!!
    ENDFORM.                               " register_events
    As soon as you open a node in the ALV tree the report will stop at the break-point.
    Now you need to check if there are still children nodes to be displayed.
    If not then trigger your special coding.
    Regards
      Uwe

  • Structure used in BAPI with prdefined field

    Hi All,
    Is it ok to use predefined field in a structure used in BAPI? Will there be any limitation? Any advantage if we use data elements and domains.
    Regards,
    Seema

    Hi,
    Using predefined fileds in a structure should not be a problem. The only think you should consider is if there is a possibility that the component owner to which this structure belongs may change this structure. So if you are sure that there will be no such risk, then go ahead.
    Domains cannot be directly used within a program/FM/BAPI. Domains can only be associated with Data elements that can be used in BAPI. It is always safe to use DATA ELEMENTS as generally changes to them are avoided as they have huge dependencies.
    I hope this clarifies your query.
    Best Regards,
    Saurabh

  • Structure incompatible in unicode environment

    Hi ,
    In Non unicode  ls_p0008 = l_ps  this assignment is working fine, but in unicode environment   i cannot make the assignment early and it says structure incompatible.
    So i have written a code as follows.
          MOVE-CORRESPONDING l_ps TO ls_p0008.
    here l_ps is like PRELP .
    and ls_p0008 like p0008.
    These PRELP having a different parameter than p008.
    so when making assignment like early the values are improperly assigned, and some part looks like #####  ############. what does it mean?
    Please help. Urgent!!!!

    Move corresponding will move the contents of the fields with the same name from one structure to another.  So long as those fields have the same definition, it should work fine.  If there are fields with different names, or different types, then you have to move their values individual. 
    ls_p0008 = l_ps simply slaps the contents of l_ps over ls_p0008, without regard for the types of the component fields.  In non-unicode this is permitted, but still bad.  Numeric fields particularly will not be readable.
    matt

  • Handling Multi hierarchial Structure using  XSLT or Java Mapping in XI

    Hello Experts,
    I have an requirement wherein i have sender as IDOC and File as Receiver.My target File structure is multi hierarchial with parent level and many child sub level node.
    I tried to generate flat structure using graphical mapping by creating an intermediate structure and then mapping it to flat structure but that seems to be very complex for my scenario as there are many sub level at target structure..
    Is there any simple way of handlng these????
    Thanks

    Hi ,
    I tried to implement your solution ..I am able to convert my idoc to XMLusing XLST but i have a question that how to convert that XMP to flat file as XI Receiver File adapter understand only 1st level of hierarchy..It doesnt understand nested level of hierarchy which is in my case...
    Below is the xslt code which i have written:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:template match="/">
              <MT_SALES_PO_DATA_INBOUND>
                   <xsl:value-of select="WPUBON01/IDOC"/>
                   <xsl:for-each select="WPUBON01/IDOC/E1WPB01">
                        <E1WBBB01>
                             <Store_ID>A001</Store_ID>
                             <SYS_INVOICE_NO>
                                  <xsl:value-of select="substring(BONNUMMER,'3','15')"/>
                             </SYS_INVOICE_NO>
                             <Cashier_ID>
                                  <xsl:value-of select="KASSID"/>
                             </Cashier_ID>
                        </E1WBBB01>
                   </xsl:for-each>
                   <xsl:for-each select="WPUBON01/IDOC/E1WPB01/E1WPB02">
                        <E1WBB02>
                             <Transaction_Type>
                                  <xsl:value-of select="VORGANGART"/>
                             </Transaction_Type>
                             <Article_Description>
                                  <xsl:value-of select="QUALARTNR"/>
                             </Article_Description>
                             <ITEM_CODE>
                                  <xsl:value-of select="ARTNR"/>
                             </ITEM_CODE>
                             <xsl:for-each select="WPUBON01/IDOC/E1WPB01/E1WPB02/E1WBB03">
                                  <E1WBB03>
                                       <Condition_Type>
                                            <xsl:value-of select="KONDITION"/>
                                       </Condition_Type>
                                       <xsl:for-each select="">
                                            <E1WBB04>
                                                 <TAX_Code>
                                                      <xsl:value-of select="MWSKZ"/>
                                                 </TAX_Code>
                                                 <TAX_Amount>
                                                      <xsl:value-of select="MWSBT"/>
                                                 </TAX_Amount>
                                            </E1WBB04>
                                       </xsl:for-each>
                                  </E1WBB03>
                             </xsl:for-each>
                        </E1WBB02>
                   </xsl:for-each>
              </MT_SALES_PO_DATA_INBOUND>
         </xsl:template>
    </xsl:stylesheet>
    Any idea how do i convert these XML to falt file USing XSLT or File Receiver adapter in XI???
    Thanks

  • Error when using BAPI

    Please find herewith my below code. This program i have created for transferring goods with mvt type '657' to '555' using BAPI 'BAPI_GOODSMVT_CREATE' for TCODE MB1A.
    *& Report  Z_BAPI_FOR_MB1A
    REPORT  Z_BAPI_FOR_MB1A.
    Tables : mkpf, mseg, WB2_V_MKPF_MSEG2.
    DATA:
    it_mb1a LIKE BAPI2017_GM_ITEM_CREATE OCCURS 0 WITH HEADER LINE,
    it_return LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE,
    it_ex_headret LIKE BAPI2017_GM_HEAD_RET OCCURS 0 WITH HEADER LINE,
    it_im_header LIKE BAPI2017_GM_HEAD_01, " OCCURS 0, " WITH HEADER LINE,
    it_im_gmcode LIKE BAPI2017_GM_CODE, " OCCURS 0, "WITH HEADER LINE,
    mat_doc type bapi2017_gm_head_ret-mat_doc,
    mat_docyear type bapi2017_gm_head_ret-doc_year.
    *data : lv_intense(01).
    data : it_mseg like WB2_V_MKPF_MSEG2 occurs 0 with header line,
           it_cost like csks occurs 0 with header line.
    selection-screen begin of block a with frame title text-001.
    parameters: p_date type sy-datum default sy-datum.
    select-options: so_budat for WB2_V_MKPF_MSEG2-budat,
                    so_werks for WB2_V_MKPF_MSEG2-werks_i,
                    so_matnr for WB2_V_MKPF_MSEG2-matnr_i,
                    so_lgort for WB2_V_MKPF_MSEG2-lgort_i.
    selection-screen end of block a.
    select * from WB2_V_MKPF_MSEG2 into
    table it_mseg where
    budat in so_budat and
    werks_i in so_werks and
    matnr_i in so_matnr and
    lgort_i in so_lgort and
    bwart_i = '657'.
    select * from csks into table it_cost
    for all entries in it_mseg where
    gsber = it_mseg-werks_i.
    *Filling BAPI Header Tables
    it_im_header-pstng_date = sy-datum.
    it_im_header-doc_date = sy-datum.
    it_im_gmcode-gm_code = '03'.
    *Filling BAPI Item Tables
    loop at it_mseg.
    read table it_cost with key gsber = it_mseg-werks_i.
    it_mb1a-material = it_mseg-matnr_i.
    it_mb1a-plant = it_mseg-werks_i.
    it_mb1a-stge_loc = it_mseg-lgort_i.
    it_mb1a-batch = it_mseg-charg_i.
    it_mb1a-move_type = 555. " '103'.
    it_mb1a-entry_qnt = it_mseg-menge_i.
    it_mb1a-costcenter = it_cost-KOSTL.
    it_mb1a-gl_account = '530089'.
    append it_mb1a.
    clear it_mb1a.
    clear it_cost.
    endloop.
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
      EXPORTING
        goodsmvt_header               = it_im_header
        goodsmvt_code                 = it_im_gmcode
    *   TESTRUN                       = ' '
    *   GOODSMVT_REF_EWM              =
    IMPORTING
       GOODSMVT_HEADRET              = it_ex_headret
       MATERIALDOCUMENT              = mat_doc
       MATDOCUMENTYEAR               = mat_docyear
      tables
        goodsmvt_item                 = it_mseg
    *   GOODSMVT_SERIALNUMBER         =
        return                        = it_return
    *   GOODSMVT_SERV_PART_DATA       =
    *   EXTENSIONIN                   =
    if sy-subrc = 0.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       WAIT          = 'X'
    * IMPORTING
    *   RETURN        =
    endif.
    But when i execute the above i am getting the following error.
    Runtime Errors         CALL_FUNCTION_UC_STRUCT
    Except.                CX_SY_DYN_CALL_ILLEGAL_TYPE
    Date and Time          27.01.2009 14:43:06
    Short text
         Type conflict during structure parameter transfer at CALL FUNCTION.
    What happened?
         Error in the ABAP Application Program
         The current ABAP program "Z_BAPI_FOR_MB1A" had to be terminated because it has
         come across a statement that unfortunately cannot be executed.
    Error analysis
         An exception occurred that is explained in detail below.
         The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
          not caught and
         therefore caused a runtime error.
         The reason for the exception is:
         In the function "BAPI_GOODSMVT_CREATE", the STRUCTURE parameter "GOODSMVT_ITEM"
          is typed in such a way
         that only actual parameters are allowed, which are compatible in Unicode
          with respect to the fragment view. However, the specified actual
         parameter "IT_MSEG" has an incompatible fragment view.
    Missing Handling of System Exception
         Program                                 Z_BAPI_FOR_MB1A
    Trigger Location of Exception
        Program                                 Z_BAPI_FOR_MB1A
        Include                                 Z_BAPI_FOR_MB1A
        Row                                     72
        Module Name                             START-OF-SELECTION
    Source Code Extract
    Line  SourceCde
       42 lgort_i in so_lgort and
       43 bwart_i = '657'.
       44
       45 select * from csks into table it_cost
       46 for all entries in it_mseg where
       47 gsber = it_mseg-werks_i.
       48 *Filling BAPI Header Tables
       49 it_im_header-pstng_date = sy-datum.
       50 it_im_header-doc_date = sy-datum.
       51 it_im_gmcode-gm_code = '03'.
       52
       53 *Filling BAPI Item Tables
       54 loop at it_mseg.
       55
       56 read table it_cost with key gsber = it_mseg-werks_i.
       57
       58 it_mb1a-material = it_mseg-matnr_i.
       59 it_mb1a-plant = it_mseg-werks_i.
       60 it_mb1a-stge_loc = it_mseg-lgort_i.
       61 it_mb1a-batch = it_mseg-charg_i.
       62 it_mb1a-move_type = 555. " '103'.
      64 it_mb1a-costcenter = it_cost-KOSTL.
      65 it_mb1a-gl_account = '530089'.
      66
      67 append it_mb1a.
      68 clear it_mb1a.
      69 clear it_cost.
      70 endloop.
      71
    72*>>>> CALL FUNCTION 'BAPI_GOODSMVT_CREATE'*  73   EXPORTING
      74     goodsmvt_header               = it_im_header
      75     goodsmvt_code                 = it_im_gmcode
      76 *   TESTRUN                       = ' '
      77 *   GOODSMVT_REF_EWM              =
      78  IMPORTING
      79    GOODSMVT_HEADRET              = it_ex_headret
      80    MATERIALDOCUMENT              = mat_doc
      81    MATDOCUMENTYEAR               = mat_docyear
      82   tables
      83     goodsmvt_item                 = it_mseg
      84 *   GOODSMVT_SERIALNUMBER         =
      85     return                        = it_return
      86 *   GOODSMVT_SERV_PART_DATA       =
      87 *   EXTENSIONIN                   =
      88           .
      89 if sy-subrc = 0.
      90 CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      91  EXPORTING
    Can u explain why this is coming. Your valuable suggestions are required.
    Thanks,
    Jitesh M Nair

    Hi,
    Try this Code.
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
            EXPORTING
              GOODSMVT_HEADER       = WF_HEADER
              GOODSMVT_CODE         = WF_CODE
              TESTRUN               = WL_space
            IMPORTING
              MATERIALDOCUMENT      = FS_MATERIAL_DOC
            TABLES
              GOODSMVT_ITEM         = INT_ITEM
              GOODSMVT_SERIALNUMBER = INT_SERIALNO
              RETURN                = INT_RETURN1.
    *VARIABLES for goods movement creation bapi
    DATA : WF_HEADER  TYPE   BAPI2017_GM_HEAD_01,
           WF_CODE    TYPE   BAPI2017_GM_CODE.
    DATA : FS_MATERIAL_DOC   TYPE BAPI2017_GM_HEAD_RET-MAT_DOC,
           FS_SERIALNO       TYPE BAPI2017_GM_SERIALNUMBER,
           FS_ITEM           TYPE BAPI2017_GM_ITEM_CREATE,
           FS_RETURN1        TYPE BAPIRET2,
    data declaration for goods movement creation bapi
    DATA : INT_ITEM     TYPE TABLE OF BAPI2017_GM_ITEM_CREATE,
           INT_SERIALNO TYPE TABLE OF BAPI2017_GM_SERIALNUMBER,
           INT_RETURN1  TYPE TABLE OF BAPIRET2.
    Hope this will help.
    Regards,
    Rohan.

  • Populating Customized fields in Sales Order Creation using BAPI

    Hi All,
    I have a requirement that, I need to populate 2 customized fields which are appedned in the VBAK tables through Append structure. I am using BAPI_SALESORDER_CREATEFROMDAT2 FM for creating it.
    Could anybody tell me how to send these 2 coustomized field values in this BAPI using EXTERNIN parameter.
    Regards
    Rajesh
    [email protected]

    Hi,
    To add data to custom fields there are two appraoches.
    <b>1)</b>Using the <b>EXTENSIONIN</b> in the Tables option in the FM <b>BAPI_SALESORDER_CREATEFROMDAT2</b>
    Check the Documentation for the same,
    <b>Customer Enhancement for VBAK, VBAP, VBEP</b>
    <i>Description</i>
    You can use this parameter to transfer user-specific enhancments to a BAPI. The customer has to complete the EXTENSION structure and the system automatically continues processing it. If you have not defined any user-specific fields, then you can transfer a blank EXTENSIONIN structure.
    <b>Technical information about Customer Enhancements</b>
    The following description uses an example to explain how to proceed with customer enhancements to the SD tables VBAK, VBKD, VBAP and VBEP.
    The customer has added their own fields to table VBAP using the INCLUDE structure CUTEST. This structure contains 2 fields:
    CFIELD1, CHAR 10
    CFIELD2, CHAR 3.
    The customer also requires that these two fields can be maintained with the BAPI.
    1. Maintain structure CUTEST in table VBAP
    2. Because the BAPIs work with checkboxes, you must also define a CUTESTX checkbox for the customer structure. It should be structured like this:
    Field name       Data element
    CFIELD1            CHAR1
    CFIELD2          CHAR1
    3. Define these customer structures in the structures VBAPKOZ und VBAPKOZX using INCLUDE or APPEND.
    4. Add the customer structures to the BAPE_VBAP and BAPE_VBAPX BAPI structures using the APPEND technique.
    5. Adjust the following structures for customer enhancements to table VBAK:
    a) VBAKKOZ
    b) VBAKKOZX
    c) BAPE_VBAK
    d) BAPE_VBAKX
    6. Adjust the following structures for customer enhancements to table VBEK:
    a) VBEPKOZ
    b) VBEPKOZX
    c) BAPE_VBEP
    d) BAPE_VBEPX
    7. Generally, the data should be added to the BAPI interface in the internal communication structures (VBAKKOM, and so on). There, you can process the data in the SD tables (VBAK, and so on).
    8. If the EXTENSIONIN parameter contains customer data, you must complete at least the key fields in the relevant standard parameters.
    <i>For example:</i>
    You want to change customer field VBAP-CFIELD2 for item 20 to "XYZ" in order 4711.
    The following entries are expected:
    Import:     BAPIVBELN-VBELN       = '0000004711'  Document number
                BAPISDHD1X-UPDATEFLAG = 'U'           UPDKZ for doc header
    Tables:     BAPISDITM-ITM_NUMBER  = '000020'      Item number
                BAPISDITMX-ITM_NUMBER = '000020'      Item number
              + BAPISDITMX-UPDATEFLAG = 'U'           UPDKZ for item
    You must complete the EXTENSION table as follows:
    STRUCTURE                          VALUEPART1       1234561234567890123
    BAPE_VBAP                       0000004711000020                 XYZ
    BAPE_VBAPX                      0000004711000020       X
    <b>Further Information</b>
    You can find more information in the BAPI programming guide in the chapter for enhancements to BAPIs.
    Notes
    You must complete the STRUCTURE field with the name of the relevant enhancement structure (BAPE_VBAK, BAPE_VBAP, BAPE_VBEP). You can complete the remaining fields with the append structures from the enhancement structures.
    At the moment, you can use the BAPI to store enhancements in the following structures:
    VBAK : An enhancement to header data requires an append structure to BAPE_VBAK and an enhancement to structure VBAKKOZ.
    VBAP : An enhancement to item data requires an append structure to BAPE_VBAP and an enhancment to structure VBAPKOZ.
    VBEP : An enhancement to schedule line data requires an append structure to BAPE_VBEP and an enhancement to structure VBEPKOZ.
    VBKD : If you are using an enhancement for header data, you must add an append structure to BAPE_VBAK. You also need to enhance structure VBAKKOZ. If it is for item data, you need to add an append structure to BAPE_VBAP. You must also enhance structure VBAPKOZ.
    If you also want to work with checkboxes, each X-structure must also contain an append structure.
    For example:
    A customer has created an order and wants to include the material long text (50 digits long).
    The EXTENSIONIN structure must be completed with BAPE_VBAP. Two fields have fixed definitions in this structure. These are in the VBAP host key (VBELN, POSNR). The customer sets up an append structure that contains field ZMAT50.
    Because the VBELN is normally blank when you create an order, the data can look like this:
    STRUCTURE   |BAPE_VBAP
    <b>2)</b> Create the Sales Document using the FM and when successfully craeted you will get the Sales Document No in the Export parameter <b>SALESDOCUMENT</b>.
    After its created and Committed using <b>BAPI_TRANSACTION_COMMIT</b> , do a <b>BDC</b> recording for the same to (<b>VA02</b> Change Sales Order) update the fields only and save the document.
    Regards,
    AS

  • Setting user specific contract data while creating sales order using BAPI

    Hi all,
    I am creating sales order using BAPI - BAPI_SALESORDER_CREATEFROMDAT2.
    Now my problem is that there is no structure for contract data (i.e. VEDA), system automatically set contract data using customization values.
    I am doing some validations on cotract data in MV45AFZZ which fails, because these validations are performed on standard values, user specific values r not set.
    How to handle this issue, your small clue may help a lot.
    Regards,
    S@meer

    HI
      Pricing will be carried basing on the pricing
    procedure.
    Case1: Prices will be carried out automatically if
    necessary condition records are maintained for the
    condition type.
      For this you can go to Sales Order-> Item Conditions
    In the screen you can click on command button Analysis,
    which gives you the list of condition types associated
    to the pricing procedure. By clicking on the condition
    type you can know the action that has taken place.
    Case2: Manually forcing prices for Items.
      To do this, you have to populate ORDER_CONDITIONS_IN &
    ORDER_CONDITIONS_INX. Also note to identify the item
    numbers, you manually pass the item number for each item
    in the sales order, use the same item number for
    populating conditions.
      Parameters required:
    ORDER_CONDITIONS_IN:
      ITM_NUMBER, COND_TYPE, COND_VALUE, CURRENCY
    ORDER_CONDITIONS_INX:
      ITM_NUMBER, COND_TYPE, UPDATEFLAG, COND_VALUE,CURRENCY.
       Hope the above info helps you. Do revert back if you
    need more info.
    Kind Regards
    Eswar

Maybe you are looking for

  • FM to get sales order details with billing document .

    hi , is there any standard FM or BAPI to get the sales order details with input as billing document ? i have the billing document number now i need to get the sales order number and its details .. is that possible .. i very well know how to get it by

  • Waiting for Apple to deliver your Genius results

    For the past couple of days I've noticed that the display area of my iTunes has said, "Waiting for Apple to deliver your Genius results-" And it just keeps saying that for hours on end. Anybody know why? And/or what I can do about it?

  • How can I tell if a photo is in an album?

    I am trying to organize my photos. I want to group them by albums. As I look through the Events or the Photos, how can I tell if a particular image has already been assigned to an album, and which album?

  • SMART FORM BID INVITATION

    Hi All,                     I am working on SRM I got a requirement to modify a standard smartform BBP_BID_INVITATION.  Now the problem is where can I configure the settings?                      I configured my frm in BBP_PO_ACTION_DEF transaction.

  • HUGE Customer Service Problem

    Yesterday I had two new Verizon landlines added at my home. One works fine. The other turned out to actually be someone else's telephone #. After hours on the phone with the mostunresponsive uncaring CSRs I have ever encountered, I was finally assign