Debugging ABAP Proxy code

Hi,
I have problem in ABAP Proxy. When i upload a XML and test the ABAP Proxy code it is working fine, but when i trigger the change from sender, its updating the wrong value in the database.
I checked the incoming and the converted XML, everything is correct and there is no prob in the XI.
Please tell me is there any way to debug the ABAP Proxy during the actual proccessing i,e. when the change is triggered from the sender.
Thanks and Regards,
Arunsri

I've had the same problem before...everything seemed fine but the xml was not updating the desired values - you have 2 choices - 1. Enable the debugging, but if you have a high volume scenario, then it may cause some issues. Also, I am not sure if you plan to do this in production - as you know, debugging in production is a big No-No.
Option 2 is to just take the stream and store it as a file in the OS. This is what we followed and we were able to figure out the issue with the xml. Make sure you write it in such a way that you can turn it off immediately. In our case, it worked fine for all suppliers but one and this one supplier was sending a double spaced character in between, which was causing the issue.
Regards,
Srini

Similar Messages

  • Debugging ABAP proxy

    Hi all,
    Can anyone please tell me how to debug abap proxy.
    In my scenario i chnaged the code in proxy.(file to r/3)
    I want to debug the code which i have changed..According to me it should be debugged in sm50 (testing client), which i couldnt do?
    Any Ideas greatly appreciated..
    Regards,
    smith

    Hi Paul,
    Checkout these links..
    http://help.sap.com/saphelp_nw2004s/helpdata/en/3b/6f5c3c3806af06e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/14/555f3c482a7331e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/81/845f3c31727d59e10000000a114084/frameset.htm
    Transaction Code SPROXY
    Hope they help you!
    cheers,
    Prashanth
    P.S : Please mark all helpful answers

  • ABAP proxy code using internal table

    Hi XI guru's,
    Good Afternoon,
    My Scenario is ABAP Proxy to file using ztable.
    i am getting data from Sap R/3 data base as Ztable. using this Ztable i have to write ABAP Proxy code. I generated ABAP Proxy and mentioned all below.Please send me ABAP Proxy code using this details. This is very urgent. Please help me.
    ABAP proxy class:   zco_mioa_tata
    structure              :   zmt_tata
    structure                :   zdt_tata
    structure                :   zdt_tata_employee
    Table                :   zdt_tata_employee_tab
    Ztable                :   zcnu_proxy_table
    outbound structure:
    mt_tata
        employee
    thanks and regards
    sai

    Sai,
    I guess this will help you.
    1. Proxies can be a server proxy or client proxy. In our scenarios we require proxies to send or upload the data from/into SAP system.
    2. One more thing proxies can be used if your WAS ≥ 6.2.
    3. Use Tcode SPROXY into R/3 system for proxy use.
    4. To send the data from R/3 system we use OUTBOUND PROXY. In Outbound proxy you will simply write an abap code to fetch the data from R/3 tables and then send it to XI. Below is the sample code to send the data from R/3 to XI.
    REPORT zblog_abap_proxy.
    DATA prxy TYPE REF TO zblogco_proxy_interface_ob.
    CREATE OBJECT prxy.
    DATA it TYPE zblogemp_profile_msg.
    TRY.
    it-emp_profile_msg-emp_name = 'Sarvesh'.
    it-emp_profile_msg-empno = '01212'.
    it-emp_profile_msg-DEPARTMENT_NAME = 'NetWeaver'.
    CALL METHOD prxy->execute_asynchronous
    EXPORTING
    output = it.
    commit work.
    CATCH cx_ai_system_fault .
    DATA fault TYPE REF TO cx_ai_system_fault .
    CREATE OBJECT fault.
    WRITE :/ fault->errortext.
    ENDTRY.
    Receiver adapter configurations should be done in the integration directory and the necessary sender/receiver binding should be appropriately configured. We need not do any sender adapter configurations as we are using proxies.
    5. To receive data into R/3 system we use INBOUND PROXY. In this case data is picked up by XI and send it to R/3 system via XI adapter into proxy class. Inside the inbound proxy we careate an internal table to take the data from XI and then simply by using the ABAP code we update the data inot R/3 table. BAPI can also be used inside the proxy to update the data into r/3.
    I hope this will clear few doubts in proxy.
    Just go through these links:
    http://help.sap.com/saphelp_nw04/helpdata/en/14/555f3c482a7331e10000000a114084/frameset.htm
    ABAP Server Proxies By Siva Maranani
    /people/siva.maranani/blog/2005/04/03/abap-server-proxies
    /people/sravya.talanki2/blog/2006/07/28/smarter-approach-for-coding-abap-proxies
    /people/vijaya.kumari2/blog/2006/01/26/how-do-you-activate-abap-proxies
    /people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy
    File to R/3 via ABAP Proxy with good example
    /people/prateek.shah/blog/2005/06/14/file-to-r3-via-abap-proxy
    http://help.sap.com/saphelp_nw2004s/helpdata/en/48/d5a1fe5f317a4e8e35801ed2c88246/frameset.htm
    Generating java proxies..
    /people/prasad.ulagappan2/blog/2005/06/27/asynchronous-inbound-java-proxy
    /people/rashmi.ramalingam2/blog/2005/06/25/an-illustration-of-java-server-proxy
    Synchronous Proxies:
    Outbound Synchronous Proxy
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/abap%2bproxy%2boutbound%2bprogram%2b-%2bpurchase%2border%2bsend
    Inbound Synchronous Proxy
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/abap%2bproxy%2binbound%2bprogram%2b-%2bsales%2border%2bcreation
    Regards,
    Sarvesh

  • My simple Inbound ABAP Proxy code doesn't work in PI 7.1 EHP1 SP3 ?

    Hi,
    I just installed and configure new PI 7.1 EHP 1 SP3 and i tried some simple abap proxy but seems like doesn't work.
    Please advise what is missing base on my simple abap code below :
    =================================================================================================
    METHOD zpi711ii_si_syn_in_aaeproxy~si_syn_in_aaeproxy.
    **** INSERT IMPLEMENTATION HERE **** ***
    DATA: inputdata TYPE ZPI711MT_REQ_1,
    outputdata TYPE ZPI711MT_RES_1.
    CONCATENATE inputdata-mt_req_1-firstname ' ' inputdata-mt_req_1-lastname INTO outputdata-mt_res_1-fullname.
    ENDMETHOD.
    =================================================================================================
    i have put some break on the CONCATENATE seems like inputdata-mt_req_1-firstname is empty ? why ?
    The sample xml input is :
    =================================================================================================
    <n0:MT_REQ_1 xmlns:n0="http://www.abeam.com/sample/pi" xmlns:prx="urn:sap.com:proxy:ST6:/1SAI/TAS1190827B531A473B357B:700:2008/06/25">
    <FIRSTNAME>This is a string 4</FIRSTNAME>
    <LASTNAME>This is a string 5</LASTNAME>
    </n0:MT_REQ_1>
    =================================================================================================
    Please advise
    Thank You and Best Regards
    Fernand

    Hi Fernand ,
    Few things to check :
    1. hope you are accessing the correct node of proxy structure and the correct message type too.
    2.. If the occurrence of node is 1 to many than it will be a table type in that case your need to use a loop to access row values.
    Make sure that you have used the correct message types for creating variables..
    DATA: inputdata TYPE ZPI711MT_REQ_1,
    outputdata TYPE ZPI711MT_RES_1.
    --->inputdata-mt_req_1-firstname ' ' inputdata-mt_req_1-lastname
    >once you have created the variable of particular messagetype than you have to use in this format inputdata-firstname and inputdata-lastname. seems some thing fishy here...inputdata-mt_req_1-firstname/lastname.
    Regards ,

  • 7.1 Client ABAP proxy code sample (outbound)

    Hi guys,
    has somebody implemented new 7.0(7.1) abap proxies using ws runtime?
    Could you please post some sample code of client abap proxy?
    The 3. proxies were quite easy, but I'm a little bit confused in 7.0 and it's ws-rm.
    Thanks a lot, Olian

    Create a client proxy (for eg. the name would be like ZCO_MI_EMP_OUT_SYNC).
    Create a report program for the client proxy.
    report  yh_proxyclient.
    *  tables: ZEMP_DTLS_COPY.
       data: input type zmt_emp_tar1 .
       data: output type zmt_emp_src1 .
       data: client type ref to zco_mi_emp_out_sync .
      output-mt_emp_src-dept_id = 'SAP EP'.
      data wa_emp type zdt_emp_tar_employee.
      data wa_empinsert type zemp_dtls_copy. "ZDT_EMP_TAR_EMPLOYEE.
    try.
        create object client
    *  EXPORTING
    *    logical_port_name  =
      catch cx_ai_system_fault .
    endtry.
    try.
    call method client->execute_synchronous
      exporting
        output = output
      importing
        input  = input
    catch cx_ai_system_fault .
    catch cx_ai_application_fault .
    endtry.
    loop at input-mt_emp_tar-employee into wa_emp.
      write: / wa_emp-emp_id, wa_emp-dept_id, wa_emp-emp_name, wa_emp-emp_address.
    endloop.
      commit work.
    endmethod
    the above code is taken fron this wiki  (step by step guide using an example)
    [https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/abapClientProxytoABAPServerProxy+Scenario]

  • ABAP proxy code

    Hi,
    i need to write a report program to trigger client proxy
    input parameters for the report company code and based on company code FM extract information which is defined in tables option.
    how do i map the proxy table to FM table.
    below mentioed are reference details.
    class: ZSVCO_FILE_BR_OUT_ASYNC
    Message Type: ZSVFILE_BR
    proxy Table: BR_DETAILS
    i am following the blog by ravikumar .
    REPORT  Z_BR_RECON                              .
    DATA prxy TYPE REF TO ZSVCO_FILE_BR_OUT_ASYNC.
    CREATE OBJECT prxy.
    DATA it TYPE  ZSVFILE_BR.
    TRY.
        it-BR_DETAILS-field1= map to functoin module table
        it-BR_DETAILS-field1= map to functoin module table
        it-BR_DETAILS-field3= map to functoin module table
        CALL METHOD prxy->execute_asynchronous
          EXPORTING
            output = it.
         commit work
      CATCH cx_ai_system_fault .
        DATA fault TYPE REF TO cx_ai_system_fault .
        CREATE OBJECT fault.
        WRITE :/ fault->errortext.
    ENDTRY.

    Hi-
    Check out this blogs,hope its helpful to you...
    ABAP Proxy
    /people/vijaya.kumari2/blog/2006/01/26/how-do-you-activate-abap-proxies
    Client Proxy
    /people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy
    Server Proxy
    /people/siva.maranani/blog/2005/04/03/abap-server-proxies
    Proxy code
    /people/sravya.talanki2/blog/2006/07/28/smarter-approach-for-coding-abap-proxies

  • ABAP proxy code help needed

    Hi,
    In the ABAP inbound (server) proxy, I have written code like this.
    DATA: lt_material TYPE TABLE OF zxdt_material,
            ls_material TYPE zxdt_material,
            ls_input type zxmt_cam.
    ls_input = input.
    lt_material = ls_input-mt_cam-material.
    Here, material is a table type which should have 10 records of material. But it has only one records always eventhough I am passing 10 records in the input xml.
    What could be the reason?
    Any help is really appreciated since I am trying this for a long time now.
    Thanks
    Ricky

    Example code...
    here header has simple structure type (non repeating) so we directly assigning fields
    INPUT-ACCOUNTLIST-ACCOUNTDETAILINFO has proxy table structure(repeating structure) ,.... so we have used internal table for that..
    FUNCTION Z_00FI_ACCOUNTS_RECON_DAT.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(INPUT) TYPE  ZDT_ACCOUNT_RECON_INFO_TARGET4
    TABLES:ZT00FI_ACCDATA,                       "Accounts Data
           ZT00FI_ACCHEAD.
    DATA:
         LT_ACCOUNTLIST TYPE TABLE OF  ZDT_ACCOUNT_RECON_INFO_TARGET3,
         LT_ACCDATATAB TYPE TABLE OF ZT00FI_ACCDATA,
         LT_ACCHEADERTAB TYPE TABLE OF ZT00FI_ACCHEAD,
         LS_ACCOUNTLIST TYPE  ZDT_ACCOUNT_RECON_INFO_TARGET3,
         LS_ACCDATATAB TYPE ZT00FI_ACCDATA,
         LS_ACCHEADERTAB TYPE ZT00FI_ACCHEAD,
         LS_HEADER TYPE ZDT_ACCOUNT_RECON_INFO_TARGET.
        SELECT SINGLE * FROM ZT00FI_ACCHEAD
        WHERE BATCHID = INPUT-HEADER-BATCHID AND
              SUBBATCHID = INPUT-HEADER-SUBBATCHID.
    *IF SY-SUBRC NE 0.
    MOVE:
      INPUT-HEADER-SOURCEREF TO LS_ACCHEADERTAB-SOURCEREF,
      INPUT-HEADER-BATCHID TO LS_ACCHEADERTAB-BATCHID,
      INPUT-HEADER-SUBBATCHID TO LS_ACCHEADERTAB-SUBBATCHID,
      INPUT-EXTRACTIONINFO-DATAVERSION TO LS_ACCHEADERTAB-DATAVERSION,
      INPUT-EXTRACTIONINFO-SOURCESYSTEM TO LS_ACCHEADERTAB-SOURCESYSTEM,
      INPUT-EXTRACTIONINFO-COUNTRYCODE TO LS_ACCHEADERTAB-COUNTRYCODE,
      INPUT-EXTRACTIONINFO-NUMBEROFACCOUNTS TO LS_ACCHEADERTAB-NUMBEROFACCOUNTS,
      INPUT-EXTRACTIONINFO-STARTTIMESTAMP TO LS_ACCHEADERTAB-STARTIMESTAMP,
      INPUT-EXTRACTIONINFO-ENDTIMESTAMP TO LS_ACCHEADERTAB-ENDTIMESTAMP,
      INPUT-EXTRACTIONINFO-DELTAINDICATOR TO LS_ACCHEADERTAB-DELTAINDICATOR,
      INPUT-EXTRACTIONINFO-LASTBATCHINDICAT TO LS_ACCHEADERTAB-LASTBATCHINDICAT.
    MOVE 'N' TO LS_ACCHEADERTAB-PROCESSINDICATOR.
    APPEND LS_ACCHEADERTAB TO LT_ACCHEADERTAB.
    INSERT ZT00FI_ACCHEAD FROM TABLE LT_ACCHEADERTAB.
    MOVE INPUT-ACCOUNTLIST-ACCOUNTDETAILINFO TO LT_ACCOUNTLIST.
    LOOP AT LT_ACCOUNTLIST INTO LS_ACCOUNTLIST.
      MOVE:
      INPUT-HEADER-BATCHID TO LS_ACCDATATAB-BATCH_ID,
      INPUT-HEADER-SUBBATCHID TO LS_ACCDATATAB-SUBBATCH_ID.
      MOVE-CORRESPONDING LS_ACCOUNTLIST TO LS_ACCDATATAB.
      APPEND LS_ACCDATATAB TO LT_ACCDATATAB.
      CLEAR:LS_ACCOUNTLIST,
            LS_ACCDATATAB.
    ENDLOOP.
    INSERT ZT00FI_ACCDATA FROM TABLE LT_ACCDATATAB.
    COMMIT WORK.
    *ENDIF.
    ENDFUNCTION.

  • How to debug XI--- R/3 (abap server proxy) code,  SYSFAIL in SMQ2

    Hi
    i have a XI (BPM) to R/3 (ABAP server proxy) scenario,
    when the data goes from XI to R/3, it is getting stuck at R/3 inbound queue (SMQ2), with status : SYSFAIL and error text: "No roll storage space of length
    3391496 available for internal storage",
    we tried activating the queue/ reexecute the LUW, but it still shows the same error status after running for some time,
    how can i debug the ABAP server proxy,
    pls tell me how can i debug the ABAP proxy code in the R/3
    very critical issue

    Have a look at SAP Note 17965 - No storage space available
    Regards,
    Prateek

  • Inbound synchronous ABAP proxy in PI 7.1?

    Hi All,
    Can anyone provide me sample ABAP proxy code for inbound synchronous. I have created inbound synchronous service interface, generated proxy in ABAP system. It has only one method in ABAP proxy class with input and output. When I write code ti take the input, process and send an output, its not getting delivered.
    Please help me with sample code or guidence on this. Looks like there are changes in 7.1 when compared with previous versions that EXECUTE_SYNCHRONOUS doesn't exist anymore.Do we just eed to write code in single method with in the class?
    Regards,
    N@v!n

    On Sproxy - >
    Focus on your interface - >
    go to your inbound interface name(service interface) -> double click
    On PROPERTIES TAB -> INTERFACE -> PROVIDER CLASS -> DOUBLE CLICK ON IT ->
    Now One method name is coming - > Double click on it ->
    Congarts ! you will write your code Here ...
    I am Pasting a sample code used in my case , similarly you can compare for your self. :
    __________________________________________________________ Declare Area
    DATA:   IT_INPUT    TYPE  ZPROCESS_ORDER_FILE_ROW_TAB2,
                  WA_INPUT    TYPE  ZPROCESS_ORDER_FILE_ROW2.
    DATA:   IT_FINAL   TYPE  ZPROCESS_ORDER_RESPONSE_RO_TAB,
                  WA_FINAL   TYPE  ZPROCESS_ORDER_RESPONSE_ROW.
    I get this Types from
    go to your inbound interface name(service interface) -> double click
    USED OBJECT TAB
    Here you will get  2 table type Structure for Internal table Finaland Input Both.
    as well as Work area Types.
    _________________  Actual Code -
    IT_INPUT = INPUT-PROCESS_ORDER_FILE-ROW.
    This Structure you get in
    go to your inbound interface name(service interface) -> double click
    USED EXTRENAL VIEW TAB.
    Use ABAP NAME HERE ..
    Populate IT_FINAL according to you and pass it out.
    SImialry for sending Out ....
    OUTPUT-PROCESS_ORDER_RESPONSE-ROW = IT_FINAL.
    Hope it help...
    Still Doubts , Write here ...
    Regards
    Prabhat Sharma.

  • JDBC--XI---ABAP Proxy

    Dear Experts,
    I have a scenario from DB system I am given a stored procedure that gives me the contents for creating sales orders in SAP ECC system. Now I have written a ABAP proxy code, internally I have used BAPI for sales order creation,  the sales order which gets generated in ECC system through BAPI   and Intendet number  coming from DB needs  to be updated back to the same table where the stored procedure is picking up the data, the updation Stored Procedure has been provided and I have done the mapping part of it also.
    For this my approach I designed is
    Sender JDBC Adapter using Stored procedure and creating Sales orders in ECC using Receiver ABAP Proxy and for this I have not used Synchronous Updates and similarly in ABAP proxy  I have used BAPI which creates Sales Orders and returns the Sales order and i would need to pick the Intendts and Sales orders , both of which I need to send back to DB system, for this I am using the same Inbound proxy code which generates Sales order number and i would want to call the Outbound proxy from the same Inbound proxy to send back the Sales order number and Intedent.
    My question can any of you give me some reference as to how i can call an Outbound proxy (Sending Sales order number,Intedents) in the same Inbound Proxy(which creates Sales orders) to send the Updates to the DB system.
    I have created 2 Outbound Asynchornous Service interfaces and 2 inbound Asynchronous Interfaces.
    Regards,
    KishoreJ.

    Hi Stefan,
    Thanks for the example, using that I have delcared and called the Outbound proxy in my Inbound proxy using its relevent method. Now there is a small problem, The system states that SalesOrder number not compaitable which which i am passing to the method.
    For your reference
    create object lo_salesorderout.
    TRY.
    CALL METHOD lo_salesorderout->si_ob_sap_to_fms_ordernumber
      EXPORTING
        output = salesorder  .----
    Error is being thrown here
    CATCH cx_ai_system_fault .
    ENDTRY.
    So for the reference in Inbound proxy I have defined this as
    Data: salesordernumber type vbeln
    and in SAP XI this is regarded as a String, should I first convert the String type to VBELN of type Char 10.
    Thank You,
    KishoreJ.

  • ABAP Proxy with Party

    Party is using to group business systems of one partner?
    I have in one party business system which comunicate with Abap Proxy. But when I send message to SAP PI, I receive message with out Party.
    BS_ERP(abap-proxy) -> SAP PI
    Configuration looks like:
    Party
       +   Partner_1
            +   Service
                +   Business System
                    +  BS_ERP
                        +  Communaction Channel
                            +   CC_XI_Proxy_Sender
    How can abap proxy set PARTY of sender?

    My Integration Builder Configuration looks:
    Party
      + Partner_1
        + Service
          + Business System
            + BS_ERP
              + Communaction Channel
                + CC_XI_Proxy_Sender
                + CC_XI_Proxy_Receiver
    As you see business system is assigned to Party.
    If I send message from PI to BS_ERP message is:
    Sender Party: ####
    Sender Service: ####
    Receiver Party: Partner_1
    Receiver Service: BS_ERP
    If I send message BACK from BS_ERP to PI message is:
    Sender Party: _____
    Sender Service: BS_ERP
    Receiver Party: ####
    Receiver Service: ####
    Abap-proxy code is:
    DATA lv_proxy TYPE REF TO zxx_mi_somedata_outbound.(CL_PROXY_CLIENT)
    DATA lv_msg TYPE zxxmt_somedata_outbound.
    CREATE OBJECT lv_proxy.
    CALL METHOD lv_proxy->mi_somedata_outbound
      EXPORTING
        output = lv_msg.
    Where can I set that message send from party "Partner_1"?

  • Receiver as ABAP Proxy

    Hi
    I am trying to implement the following scenario:
    - A SQL database is pooled and updated records and with the help of XI i have to call a BAPI in the R/3 system to create a sales order using ABAP Proxy.so before i create the Sales order i have to do a lot of validations like whether the customer code is existing,whether the material is a an existing material or not and many more.so can someone tell me how will i do all these validations before creating the sales order.
    Thanks and Regards,
    Jishi

    Hi,
    <i>Since the ABAP proxy code is written in the XI server</i> is not correct perception.
    Let me clarify a few things...
    ABAP Proxy code is not written in XI Server. U generate an ABAP Proxy for the ,message Interfaces developed in XI, in your target SAP system.
    When u generate the Proxy for the Message Interface in SAP system, it helps you in marshalling and unmarshalling of XML data.
    In the Execute synchronous/ execute asynchronous method of the generated proxy, u actually write the code/ busineess logic for ur validations.
    If all validations are successful then u call the sales order BAPI.
    Cheers,
    siva Maranani.

  • Debugging of inbound ABAP proxy

    Please To show the debugging of inbound ABAP proxy, the implementation of the demo scenario is used. The demo scenario is available in any installation WebAS 6.40 or higher.

    follow this method and check debugging mode.
    Debugging of inbound proxies in WebAS 6.40 or higher
    To show the debugging of inbound ABAP proxy, the implementation of the demo scenario is used. The demo scenario is available in any installation WebAS 6.40 or higher.
    At first you have to set a break point in the ABAP code. Call transaction SPROXY. Expand the namespace http://sap.com/xi/XI/Demo/Airline, the node Message Interface (inbound) and the interface FlightBookingOrderRequest_In.
    Double click on interface II_SXIDAL_FBO_REQUEST and get the view of the proxy object properties.
    Double click on the implementing class (ABAP name) and then double click on the method name (this class has only one method).
    Now you are in the inbound proxy implementation. Set the break point on the first executable line.
    With help of the back button (F3) go back to the transaction SPROXY. Here you choose from menu Proxy -> Test Interface
    In the next pop up check the field XML Editor to maintain the payload.
    In the next screen apply suitable values or upload the XML payload of the SXMB_MONI (after mapping).
    Now the inbound proxy processing should stop at the break point.
    If the processing does not stop at the break point, there might be an error in the XML. Check at the result page for error messages.
    Debugging of inbound proxies in WebAS 6.20
    You set the break point the same way as described above.
    To start the proxy test you call the report SPRX_TEST_INBOUND.
    As parameters you enter the name of the ABAP interface and the method name of of the ABAP interface and check the parameter Edit Native XML
    In the next screen you apply suitable values or upload the XML payload of the SXMB_MONI (after mapping).
    Then you click first on save button (F11), then on back button (F3).
    Now you should see your debug session. If not, check if the XML is valid. BAPI_GOODSMVT_CREATE to post Goods Movement
    The following is an abap program making used of the BAPI function BAPI_GOODSMVT_CREATE to do Goods Receipts for Purchase Order after importing the data from an external system.
    BAPI TO Upload Inventory Data
    GMCODE Table T158G - 01 - MB01 - Goods Receipts for Purchase Order
                         02 - MB31 - Goods Receipts for Prod Order
                         03 - MB1A - Goods Issue
                         04 - MB1B - Transfer Posting
                         05 - MB1C - Enter Other Goods Receipt
                         06 - MB11
    Domain: KZBEW - Movement Indicator
         Goods movement w/o reference
    B - Goods movement for purchase order
    F - Goods movement for production order
    L - Goods movement for delivery note
    K - Goods movement for kanban requirement (WM - internal only)
    O - Subsequent adjustment of "material-provided" consumption
    W - Subsequent adjustment of proportion/product unit material
    report zbapi_goodsmovement.
    parameters: p-file like rlgrap-filename default
                                     'c:\sapdata\TEST.txt'.
    parameters: e-file like rlgrap-filename default
                                     'c:\sapdata\gdsmvterror.txt'.
    parameters: xpost like sy-datum default sy-datum.
    data: begin of gmhead.
            include structure bapi2017_gm_head_01.
    data: end of gmhead.
    data: begin of gmcode.
            include structure bapi2017_gm_code.
    data: end of gmcode.
    data: begin of mthead.
            include structure bapi2017_gm_head_ret.
    data: end of mthead.
    data: begin of itab occurs 100.
            include structure bapi2017_gm_item_create.
    data: end of itab.
    data: begin of errmsg occurs 10.
            include structure bapiret2.
    data: end of errmsg.
    data: wmenge like iseg-menge,
          errflag.
    data: begin of pcitab occurs 100,
            ext_doc(10),           "External Document Number
            mvt_type(3),           "Movement Type
            doc_date(8),           "Document Date
            post_date(8),          "Posting Date
            plant(4),              "Plant
            material(18),          "Material Number
            qty(13),               "Quantity
            recv_loc(4),           "Receiving Location
            issue_loc(4),          "Issuing Location
            pur_doc(10),           "Purchase Document No
            po_item(3),            "Purchase Document Item No
            del_no(10),            "Delivery Purchase Order Number
            del_item(3),           "Delivery Item
            prod_doc(10),          "Production Document No
            scrap_reason(10),      "Scrap Reason
            upd_sta(1),            "Update Status
          end of pcitab.
    call function 'WS_UPLOAD'
      exporting
        filename                      = p-file
        filetype                      = 'DAT'
    IMPORTING
      FILELENGTH                    =
      tables
        data_tab                      = pcitab
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      OTHERS                        = 6
    if sy-subrc <> 0.
      message id sy-msgid type sy-msgty number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      exit.
    endif.
    gmhead-pstng_date = sy-datum.
    gmhead-doc_date = sy-datum.
    gmhead-pr_uname = sy-uname.
    gmcode-gm_code = '01'.   "01 - MB01 - Goods Receipts for Purchase Order
    loop at pcitab.
      itab-move_type  = pcitab-mvt_type.
      itab-mvt_ind    = 'B'.
      itab-plant      = pcitab-plant.
      itab-material   = pcitab-material.
      itab-entry_qnt  = pcitab-qty.
      itab-move_stloc = pcitab-recv_loc.
      itab-stge_loc   = pcitab-issue_loc.
      itab-po_number  = pcitab-pur_doc.
      itab-po_item    = pcitab-po_item.
      concatenate pcitab-del_no pcitab-del_item into itab-item_text.
      itab-move_reas  = pcitab-scrap_reason.
      append itab.
    endloop.
    loop at itab.
      write:/ itab-material, itab-plant, itab-stge_loc,
              itab-move_type, itab-entry_qnt, itab-entry_uom,
              itab-entry_uom_iso, itab-po_number, itab-po_item,
                                                  pcitab-ext_doc.
    endloop.
    call function 'BAPI_GOODSMVT_CREATE'
      exporting
        goodsmvt_header             = gmhead
        goodsmvt_code               = gmcode
      TESTRUN                     = ' '
    IMPORTING
        goodsmvt_headret            = mthead
      MATERIALDOCUMENT            =
      MATDOCUMENTYEAR             =
      tables
        goodsmvt_item               = itab
      GOODSMVT_SERIALNUMBER       =
        return                      = errmsg
    clear errflag.
    loop at errmsg.
      if errmsg-type eq 'E'.
        write:/'Error in function', errmsg-message.
        errflag = 'X'.
      else.
        write:/ errmsg-message.
      endif.
    endloop.
    if errflag is initial.
      commit work and wait.
      if sy-subrc ne 0.
        write:/ 'Error in updating'.
        exit.
      else.
        write:/ mthead-mat_doc, mthead-doc_year.
        perform upd_sta.
      endif.
    endif.
          FORM UPD_STA                                                  *
    form upd_sta.
      loop at pcitab.
        pcitab-upd_sta = 'X'.
        modify pcitab.
      endloop.
      call function 'WS_DOWNLOAD'
        exporting
          filename                      = p-file
          filetype                      = 'DAT'
    IMPORTING
      FILELENGTH                    =
        tables
          data_tab                      = pcitab
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      OTHERS                        = 6
    endform.
    *--- End of Program
    Finding the user-exits of a SAP transaction code
    Finding the user-exits of a SAP transaction code
    Enter the transaction code in which you are looking for the user-exit
    and it will list you the list of user-exits in the transaction code.
    Also a drill down is possible which will help you to branch to SMOD.
    report zuserexit no standard page heading.
    tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.
             tables : tstct.
    data : jtab like tadir occurs 0 with header line.
    data : field1(30).
    data : v_devclass like tadir-devclass.
    parameters : p_tcode like tstc-tcode obligatory.
    select single * from tstc where tcode eq p_tcode.
    if sy-subrc eq 0.
       select single * from tadir where pgmid = 'R3TR'
                        and object = 'PROG'
                        and obj_name = tstc-pgmna.
       move : tadir-devclass to v_devclass.
          if sy-subrc ne 0.
             select single * from trdir where name = tstc-pgmna.
             if trdir-subc eq 'F'.
                select single * from tfdir where pname = tstc-pgmna.
                select single * from enlfdir where funcname =
                tfdir-funcname.
                select single * from tadir where pgmid = 'R3TR'
                                   and object = 'FUGR'
                                   and obj_name eq enlfdir-area.
                move : tadir-devclass to v_devclass.
              endif.
           endif.
           select * from tadir into table jtab
                         where pgmid = 'R3TR'
                           and object = 'SMOD'
                           and devclass = v_devclass.
            select single * from tstct where sprsl eq sy-langu and
                                             tcode eq p_tcode.
            format color col_positive intensified off.
            write:/(19) 'Transaction Code - ',
                 20(20) p_tcode,
                 45(50) tstct-ttext.
                        skip.
            if not jtab[] is initial.
               write:/(95) sy-uline.
               format color col_heading intensified on.
               write:/1 sy-vline,
                      2 'Exit Name',
                     21 sy-vline ,
                     22 'Description',
                     95 sy-vline.
               write:/(95) sy-uline.
               loop at jtab.
                  select single * from modsapt
                         where sprsl = sy-langu and
                                name = jtab-obj_name.
                       format color col_normal intensified off.
                       write:/1 sy-vline,
                              2 jtab-obj_name hotspot on,
                             21 sy-vline ,
                             22 modsapt-modtext,
                             95 sy-vline.
               endloop.
               write:/(95) sy-uline.
               describe table jtab.
               skip.
               format color col_total intensified on.
               write:/ 'No of Exits:' , sy-tfill.
            else.
               format color col_negative intensified on.
               write:/(95) 'No User Exit exists'.
            endif.
          else.
              format color col_negative intensified on.
              write:/(95) 'Transaction Code Does Not Exist'.
          endif.
    at line-selection.
       get cursor field field1.
       check field1(4) eq 'JTAB'.
       set parameter id 'MON' field sy-lisel+1(10).
       call transaction 'SMOD' and skip first   screen.
    *---End of Program
    u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026
    Difference Between BADI and User Exits
    Business Add-Ins are a new SAP enhancement technique based on ABAP Objects. They can be inserted into the SAP System to accommodate user requirements too specific to be included in the standard delivery. Since specific industries often require special functions, SAP allows you to predefine these points in your software. 
    As with customer exits two different views are available:
    In the definition view, an application programmer predefines exit points in a source that allow specific industry sectors, partners, and customers to attach additional software to standard SAP source code without having to modify the original object. 
    In the implementation view, the users of Business Add-Ins can customize the logic they need or use a standard logic if one is available.
    In contrast to customer exits, Business Add-Ins no longer assume a two-level infrastructure (SAP and customer solutions), but instead allow for a multi-level system landscape (SAP, partner, and customer solutions, as well as country versions, industry solutions, and the like). Definitions and implementations of Business Add-Ins can be created at each level within such a system infrastructure.
    SAP guarantees the upward compatibility of all Business Add-In interfaces. Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces. You do not have to register Business Add-Ins in SSCR.
    The Business Add-In enhancement technique differentiates between enhancements that can only be implemented once and enhancements that can be used actively by any number of customers at the same time. In addition, Business Add-Ins can be defined according to filter values. This allows you to control add-in implementation and make it dependent on specific criteria (on a specific Country value, for example).
    All ABAP sources, screens, GUIs, and table interfaces created using this enhancement technique are defined in a manner that allows customers to include their own enhancements in the standard. A single Business Add-In contains all of the interfaces necessary to implement a specific task.
    The actual program code is enhanced using ABAP Objects. In order to better understand the programming techniques behind the Business Add-In enhancement concept, SAP recommends reading the section on ABAP Objects.
    What is difference between badi and user-exists?
    What is difference between enhancements and user-exists? and what is the full form of BADI?
    I have another doubt in BDC IN BDC WE HAVE MSEGCALL (i did not remember the > correct name) where the error logs are stored, MSEGCALL is a table or structure.
    What is the system landscape?
    1) Difference between BADI and USER-EXIT.
        i) BADI's can be used any number of times, where as USER-EXITS can be used only one time.
           Ex:- if your assigning a USER-EXIT to a project in (CMOD), then you can not assign the same to other project.
        ii) BADI's are oops based.
    2) About 'BDCMSGCOLL' it is a structure.  Used for finding error records.
    3) Full form of BADI 'Business addins'.
    3) System land scape will be depends on your project 
        Ex:- 'Development server'>'Quality server'-> 'Production server'...... 
    List Of User Exit Related to VL01N
    I need to some restriction in fields ( Actual GI Date, T-Code:Vl01n ).
    How do you find out whcih user exits belongs to VL01n ?
    Here is the list of user exit related to VL01N :
    V02V0001   - Sales area determination for stock transport order 
    V02V0002   - User exit for storage location determination 
    V02V0003   - User exit for gate + matl staging area determination 
    V02V0004   - User Exit for Staging Area Determination (Item) 
    V50PSTAT  - Delivery: Item Status Calculation 
    V50Q0001   - Delivery Monitor: User Exits for Filling Display Fields
    V50R0001    -  Collective processing for delivery creation 
    V50R0002    - Collective processing for delivery creation 
    V50R0004    - Calculation of Stock for POs for Shipping Due Date List
    V50S0001    - User Exits for Delivery Processing 
    V53C0001    - Rough workload calculation in time per item 
    V53C0002    - W&S: RWE enhancement - shipping material type/time slot
    V53W0001   - User exits for creating picking waves 
    VMDE0001  - Shipping Interface: Error Handling - Inbound IDoc 
    VMDE0002  - Shipping Interface: Message PICKSD (Picking, Outbound) 
    VMDE0003  - Shipping Interface: Message SDPICK (Picking, Inbound) 
    VMDE0004  - Shipping Interface: Message SDPACK (Packing, Inbound)

  • ABAP Proxy HTTP response contains status code 401

    We have a client ABAP proxy running in a program successfully in our development system. Today I transported this to our Test system. When I tested, there were no messages in the adapter engine pipeline.
    One of my colleagues discovered that when running SXMB_MONI on the Application system (_not_ the XI system), the XML queue there shows the message with an error, the error being:
    HTTP response contains status code 401 with the description Unauthorized
    I have looked at quite a few posts here with this error; the PIAPPLUSER is not locked, Integration engine is configured the same way in both Development and Test, but I cannot figure out why this is happening.
    Any assistance more than welcome!
    BR,
    Tony.

    hi,
    Check XIAPPLUSER is having this Role -SAP_XI_APPL_SERV_USER
    • If the error is in XI Adapter, then your port entry should J2EE port 5<System no>
    • If the error is in Adapter Engine
    –then have a look into SAP note- 821026, Delete the Adapter Engine cache in transaction SXI_CACHE Goto --> Cache.
    • May be wrong password for user XIISUSER
    • May be wrong password for user XIAFUSER
    – for this Check the Exchange Profile and transaction SU01, try to reset the password -Restart the J2EE Engine to activate changes in the Exchange Profile After doing this, you can restart the message
    Thanks
    Swarup

  • Consuming WebServices in ABAP WebDynPro via webservice proxy code

    Hi,
    My requirement is to consume a webservice using WSDL(basic authentication) in WebDynPro ABAP. then based on the SOAP response I need to show a pop up message whether the response valid or not.?
    I first tested the webservice by creating LPCONFIG Logical Port and generated WebService Proxy class.
    It got response correctly with basic authentication enabled each time I send a request.
    Secondly I generated webservice proxy code using service calls on creating webdynpro test application with some UI elements. Service call created Nodes,attributes and method correctly.
    it's giving me error when it tries to invoke webservice method through generated code.
    Question is that How do we code authentication to the webservice method via WebDynPro ABAP code.
    I appreciate anyone who worked on this area and taken basic authentication via coding. or worked successfully through coding.
    Thanks
    Praveen

    hi
    Refer this:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6066fbe8-edc4-2910-9584-a9601649747d
    It might be usefull for u.
    Regards
    Vivekananthan.S

Maybe you are looking for

  • Error while creating TO

    Hi All, When I am trying to create Transfer Order for an outbound delivery,I am getting the below error. An internal error has occurred (L03T 0152 H ) Message no. L3705 Diagnosis No screen sequence control is defined for the argument enclosed in pare

  • HP Laserjet CM6040MFP always paper jam on fuser when printing full photo in plain paper

    Hello, My office using Printer HP Laserjet CM6040MFP, but i have problem. The printer always paper jam on fuser when printing full photo in plain paper. i don't why, but this problem occurs on other printer with the same type. please help me - Produc

  • ITunes music wont play

    I just restored my computer from a crash, and luckily, was able to reload my itunes library from a norton 360 encrypted back-up. However none of the MP4 files will play on the new itunes 10 version. Anyone else had this problem? please advise.

  • Where to find the list of administrators on portal??

    Hi, I am trying to resolve an issue related to the login page. The customer is getting notifications in case any user registers problem loggin in. The user who fails to log in, uses the 'GET SUPPORT' link provided on the login page. On the support pa

  • How does xalan.jar work with jdk1.3.1 and not work with jdk1.4.1

    Hi, i am using java, xalan, xerces for web development. The environment is jdk1.4.1, xerces.jar, xalan.jar. i am facing problem while transforming xml, xsl. Its giving the following error java.lang.NoSuchMethodError: org.apache.xalan.xslt.Process.get