‎2008 Feb 12 7:04 AM
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
‎2008 Feb 12 7:10 AM
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
‎2008 Feb 12 7:18 AM
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.
‎2008 Feb 12 7:27 AM
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
‎2008 Feb 12 9:01 AM
can u plz send the complete code..it is difficult to understand where the data in it_final1 is populated from??
‎2008 Feb 12 10:55 AM
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
‎2011 Apr 28 9:23 PM