Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Debugg BAPI

Former Member
0 Kudos

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

9 REPLIES 9

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

se37. same as a FM.

regards,

srinivas

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

Former Member
0 Kudos

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

0 Kudos

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.

uwe_schieferstein
Active Contributor
0 Kudos

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

0 Kudos

Hi Uwe Schieferstein

Thank you so much for you response.

As you said we already checked by calling BAPI_GOODSMVT_CREATE inside the RFC enabled FN Z_BAPI_GOODSMVT_CREATE code ( we downloaded the GR data from BAPI after JCO called and compared)

we debugged the data there is no change in data after JCO passing to BAPI.

we are getting error ' 604Item 001 Ntwk actvty 9000006262 0050 budget exceeded ' message

the above error message we are not getting in frontend test(SE37 Test ,MB01,SE38 program) with the same data.

Please suggest

0 Kudos

Ramesh,

I agree with the points raised by Uwe - the error you are getting is probably due to some difference in the data. Check that there are no fields which the SAP SE37 call defaults values into, but which are left blank by the JCO. As Uwe said, especially check leading zeros - this can be difficult because SAP may add the leading zeros when you display the field in debug due to conversion exits even though they are not there in the data in reality.

My comment on using SMICM / SICF was based on the fact that a lot of the interfacing technologies in SAP now connect through the Internet Communications Manager (ICM). In SMICM you can set trace levels and look at trace files that show what is happening outside of the ABAP processing - although it can be difficult to understand. In SICF, if the Connection you are using is defined as a service you can set/display a trace; activate a recording and display it, and set/remove breakpoints. I have not used JCO so am unsure if it connects using this mechanism - just thought it worth a look.

Andrew

0 Kudos

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