Application Development and Automation 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: 
Read only

BAPI not returning the data

Former Member
0 Likes
995

Hi,

I have developed the BAPI which gets the data from few tables and puts them in one structure. But when I am running I am not getting the output. When I am debugging the same the structure is getting populated but it is not getting returned. Please let me know what could be the issue.

Regards,

Ashutosh

10 REPLIES 10
Read only

Former Member
0 Likes
958

hello ,

make sure u have mapped output tables properly.

regards

Prabhu

Read only

Former Member
0 Likes
958

Hi,

Could you please tell me which BAPI you are using?

Regards,

Rahul

Read only

0 Likes
958

Hi,

Its custom BAPI. The only thing I want to know is how to debug and find the problem once it has passed the code written by me and goes to the standard code. I am not able to find out from where in the code it gets returned.

Read only

0 Likes
958

wat is the sy-subrc value after the bapi is called.

u can try by chkin the condition if sy-subrc <> 0. display the message num, id and text.

Read only

0 Likes
958

hi,

may be you are not appending structure..........

the data is coming to structure na, once check you are appending that data or not.

Regards,

Arjun.

Read only

0 Likes
958

Hi,

This is the code that I have written in the source code section.

SELECT SINGLE NAME1 FROM KNA1 INTO KNKKTAB-NAME1 WHERE KUNNR = KUNNR .

  • endselect.

SELECT SINGLE WAERS FROM KNVV INTO KNKKTAB-WAERS WHERE KUNNR = KUNNR

.

  • endselect.

SELECT SINGLE KLIMK SKFOR FROM KNKK INTO

(KNKKTAB-KLIMK, KNKKTAB-SKFOR)

  • CORRESPONDING FIELDS OF KNKKTAB

WHERE KUNNR = KUNNR.

  • endselect.

KNKKTAB-CSKFOR = ( KNKKTAB-SKFOR / KNKKTAB-KLIMK ) * 100.

APPEND KNKKTAB.

KNKKTAB is the structure that I am using which contains NAME1 WAERS KLIMK SKFOR CSKFOR fields. Please let me know what could be the reason.

Read only

0 Likes
958

if this is only the code you have then there is no faults in your code.

Check whether you have cleared the internal table body at the end.

Donot test your bapi from your program instead run it independently in SE37 and test.

Can you please list your BAPI signatures

Read only

0 Likes
958

Dear Aushutosh ,

Please check whether You have created structure of table in which you are taking values

Do as Such

Create Structure

through se11

Data Type : zname .

having field which you required

such as

name1

waers

klimk

skfor

cskfor

Then assign this Structure to your RFC i.e BAPi

in TAbles Tab

such as

Result like zname .

and then you use your code

to append data in result table

whit proper import parameter and Export parameter if any .

Regards

Deepak .

Read only

0 Likes
958

Hi ashutosh,

your question may be andwered considerably faster if you give full details from beginning:

How and from where is you BAPI called (BAPIS are only BAPIS if there is a BOR object!)?

What interface parameters of what type do you use?

You may post relevant code as code using the above <_> code button

after selecting the code with the mouse.

Regards,

Clemens

Read only

Former Member
0 Likes
958

Hi,

Not sufficient info to help you out.

Please thoroughly debug, that would be the suggestion.

As Clemens suggested, paste appropriate portions of code so that we can look through and help.

Check it you have accidentally cleared the internal tables after populating your ouput rows.