Skip to Content
author's profile photo
Former Member

How to Debugg BAPI

Hi friends

we have requirement to create GR in SAP from JAVA system through JCO.

here we are getting error whil JCO calls BAPI, the same error is not getting throgh BAPI test case and MB01( with same data).

I want to Debug the BAPI_GOODSMVT_CREATE to see how the data is processing inside the BAPI code.

I would apprciate for your valuable suggestion.

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • author's profile photo
    Former Member
    Posted on Aug 18, 2007 at 04:46 AM

    You can go to SE37 and run the BAPI in test mode to debug the code - you need to type in (cut/paste) all the input data so it is a bit tedious to do.

    Andrew

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Andrew

      Thanks for your quick response.

      this method we already tried, we passed all the data through SE37 Test case here we did not get the error.

      My question is how can i debuggt BAPI in SAP once JCO call happend?

      Thanks

  • author's profile photo
    Former Member
    Posted on Aug 18, 2007 at 06:50 AM

    se37. same as a FM.

    regards,

    srinivas

    <b>*reward for useful answers*</b>

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 18, 2007 at 11:28 AM

    To debug a function called externally you need to be able to trap the input. One possible way that works sometimes is to put a long/infinite loop into the code and then use SM50 to select the relevant work process and enter debugging.

    data: X type c.

    do.

    if x = 'X'.

    exit.

    endif.

    enddo.

    You need to find a user exit where you can put this code - perhaps an implicit enhancement at the start of the BAPI function module.

    Another option is to increase the trace level on the work process in SM50 and see if any useful information is placed in the relevant log.

    With a connection through JCO you may also be able to set trace / recording / debugging in transaction SMICM. Possibly also some settings in SICF?

    Andrew

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Andrew

      your answer is helped to me, i have done debugg throgh Infinite Loop, thank you very much.

      I am an ABAP Technical i want to know about

      please can you explain more how SMICM and SICF tocdes will help me to debugg BAPI when JCO calls.

      assigned the points for your helpfull answer.

  • author's profile photo
    Former Member
    Posted on Aug 20, 2007 at 04:28 AM

    Hello Ramesh

    If the BAPI call is technically ok then there might still be a problem with the input data. Be aware of the fact that as soon as you are using SAPGUI (e.g. SE37) all kinds of <b>conversion exits</b> are automatically executed.

    For example, field GOODSMVT_HEADER-GR_GI_SLIP_NO (BAPI_GOODSMVT_CREATE) is a Char10 field with ALPHA conversion exit. Thus, if you enter the slip number '123' in transaction SE37 the SAPGUI automatically converts this to '0000000123'. If you are calling the BAPI from outside (e.g. via JCo) a slip number '123' is not converted at all.

    Therefore my suspicion is that there are some input data that need to be converted. Check the messages that are returned in TABLES parameter RETURN which might give a hint in this direction.

    Regards

    Uwe

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Andrew Marshall

      Thanks so much your quick response.

      i agree with you , but we are getting error ' 604Item 001 Ntwk actvty 9000006262 0050 budget exceeded ' message for few GoodsReciepts ( Randomly).

      here is the data which we are passing to BAPI GOODSMVT_ITEM table:

      PLANT = '3000',

      MOVE_TYPE = '101'.

      ENTRY_QNT = '5'.

      PO_NUMBER = '4500000123'

      PO_ITEM = '10'

      IND_PROPOSE_QUANX = 'X'.

      MVT_IND = 'B'

      if you any further suggestion please give me.

      Thanks

      Ramesh