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

select statement issue- urgent pls help

Former Member
0 Likes
538

Hi

The following select statement is always failed, even LIKP table has data. pls help me

LOOP AT LT_VBRP.

IF LV_KEEP_VGBEL <> LT_VBRP-VGBEL.

LV_KEEP_VGBEL = LT_VBRP-VGBEL.

CLEAR LIKP.

SELECT single VBELN TRAID TRATY VERUR BOLNR LFDAT

FROM LIKP INTO

(LIKP-VBELN,LIKP-TRAID,LIKP-TRATY,LIKP-VERUR,LIKP-BOLNR,LIKP-LFDAT)

WHERE BOLNR = LT_VBRP-VGBEL.

IF SY-SUBRC = 0.

LV_ASN_FOUND = 'X'.

ELSE.

CLEAR LV_ASN_FOUND.

ENDIF.

ENDIF.

MOVE-CORRESPONDING LT_VBRP TO LT_LIPOV.

IF LV_ASN_FOUND = 'X'.

LT_LIPOV-VBELN = LIKP-VBELN. "ASN #

LT_LIPOV-LFDAT = LIKP-LFDAT.

  • lt_lipov-verur = likp-verur.

LT_LIPOV-BOLNR = LIKP-BOLNR. "DDL#

LT_LIPOV-KOMAU = LIKP-VBELN.

  • get the ASN line number details.

SELECT VBELN POSNR MATNR ERDAT LFIMG ERNAM WERKS VGBEL VGPOS FROM LIPS INTO

TABLE LT_LIPOV

WHERE VBELN = LIKP-VBELN.

ELSE.

CLEAR LT_REP-VBELN.

CLEAR LT_REP-LFDAT.

CLEAR LT_REP-VERUR.

CLEAR LT_REP-BOLNR.

LT_REP-KOMAU = LT_VBRP-VBELN. "Inv no

LV_MESSAGE = TEXT-504.

PERFORM CREATE_REPORT_RECORD_LIN01.

LT_REP-LINE_COLOUR = 'C610'. " red Intensified

ENDIF.

APPEND LT_REP.

APPEND LT_LIPOV.

CLEAR LT_LIPOV.

CLEAR LT_REP.

ENDLOOP.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
506

Hi Kumar,

Have you checked the BOLNR values in LIKP.

Does it have '0''s prefixed to it.

If then try doing an ALPHA exit conversion to your VBRP-VGBEL which will add leading zeros.

Then use it in the select query.

Hope this helps you.

Thanks,

Arun

2 REPLIES 2
Read only

Former Member
0 Likes
507

Hi Kumar,

Have you checked the BOLNR values in LIKP.

Does it have '0''s prefixed to it.

If then try doing an ALPHA exit conversion to your VBRP-VGBEL which will add leading zeros.

Then use it in the select query.

Hope this helps you.

Thanks,

Arun

Read only

Former Member
0 Likes
506

Hi Kumar....

if statement should not be like ..

  • if lv_keep_vgbel lt_vbrp-vgbel.

Should be like this if lv_keep_vgbel = lt_vbrp-vgbel.

and try to use work area and table to select and loop the data...

Have YOu checked whether da data in it_vbrp...

there few error in way You are writing...

And one more thing in the table LIKP the field BOLNR is 35 Char and VGBEL of VBRP is 10 char ...and your are equalling that to extract the data which will not happen even..

So before select statement change VBRP-VGBEL as 35 char varible by using like this

data : v_vgbel type likp-bolnr.

loop at lt_vbrp.

  • if lv_keep_vgbel lt_vbrp-vgbel. " Why did you right the statement like this

if lv_keep_vgbel = lt_vbrp-vgbel.

clear likp.

call function 'CONVERSION_EXIT_ALPHA_INPUT'

exporting

input = lt_vbrp-vgbel

importing

output = v_vgbel.

select single vbeln traid traty verur bolnr lfdat

from likp into

(likp-vbeln,likp-traid,likp-traty,likp-verur,likp-bolnr,likp-lfdat)

where bolnr = v-vgbel.

regards,

sg

Edited by: Suneel Kumar Gopisetty on May 26, 2008 4:41 AM