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

fetchind data problem

Former Member
0 Likes
744

hi gurus,

this is my syntax for fetching kunnar value

IF IT_FINAL1[] IS NOT INITIAL.

SELECT SINGLE KUNNR FROM VBPA

INTO WA_VBPA1 WHERE VBELN = IT_FINAL1-VBELN AND PARVW = 'SP'.

MOVE WA_VBPA1-KUNNR TO WA_FINAL1-KUNNR.

IF SY-SUBRC EQ 0.

MESSAGE E000(0) WITH 'VALUE NOT THERE' .

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = WA_FINAL1-KUNNR

IMPORTING

OUTPUT = WA_FINAL1-KUNNR.

MODIFY IT_FINAL1 FROM WA_FINAL1 .

ENDIF.

data is not coming in debugging mode.

please tell me where is the fault..

thanks

subhasis

6 REPLIES 6
Read only

Former Member
0 Likes
711

Hi,

Incase you are fetching VBELN from VBAK you do have Sold-To Party in VBAK.

Table-Field Name: VBAK-KUNNR.

Else post how it_final1 is populated and that might help.

Regards

Eswar

Read only

mahaboob_pathan
Contributor
0 Likes
711

hi,

can u plz send the whole code.

u r comapring looks different.

if u r using kna1 kunnr and vbpa kunnr

then the data will be entairly different.

plz paste u r code so that it will be help full.

to answer u.

Read only

Former Member
0 Likes
711

Hi,

We normally use IF IT_FINAL1[] IS NOT INITIAL.

before select for "For All Entries".

In this case you have not used that.

You are selecting singel data from VBPA table using condition - IT_FINAL1-VBELN AND PARVW = 'SP'.

in Debug please see whats is coming in IT_FINAL1-VBELN .

Try this...

if IT_FINAL1[] is initial.

SELECT KUNNR

FROM VBPA

INTO IT_VBPA1

FOR ALL ENTRIES IN IT_FINAL1

WHERE VBELN = IT_FINAL1-VBELN AND PARVW = 'SP'.

IF SY-SUBRC EQ 0.

MESSAGE E000(0) WITH 'VALUE NOT THERE' .

endif.

endif.

Loop at it_final1 into wa_final1.

read table it_vbpa1 into wa_vbpa1 with key kunnr = wa_final1-kunnr.

if sy-subrc eq 0.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = WA_VBPA1-KUNNR

IMPORTING

OUTPUT = WA_VBPA1-KUNNR.

move WA_VBPA1-KUNNR to wa_final1-kunnr.

modify it_final1 from wa_final1-kunnr transporting kunnr.

endif.

endloop.

Regards

Avi

Read only

Former Member
0 Likes
711

can u plz send the complete code..it is difficult to understand where the data in it_final1 is populated from??

Read only

Former Member
0 Likes
711

first need to see the complete code

bt why have u given the error message when sy-subrc = 0.

it should come when your sql command doesn't works bt if sy-subrc = 0 you should call the function module without giving any error message and give the error message if sy-subrc <> 0.

rewards points if helpful

Read only

Former Member
0 Likes
711

This message was moderated.