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

ABAP Code Error on Query

former_member355038
Participant
0 Likes
1,505

Hi

I am trying to get the material document number added to an existing report and I have used the followingcode:

* Get the material document number

Clear Z_MAT_DOC_NO.

Select  VBELN FROM VBFA

WHERE VBELV = LIKP-VBELN

AND  VBTYP_N = 'R'.

However I get the error "Field list without INTO clause is not allowed. not allowed. allowed."

Can you tell me what I need to change on my code

thanks

Joe

10 REPLIES 10
Read only

Former Member
0 Likes
1,403

Hi Joe.

Try this :

DATA : LW_VBFA TYPE VBFA. " Workarea

Select single * from VBFA into corresponding fields of LW_VBFA where VBLV= LIKP-VBELN AND VBTYP_N = 'R'.

Now in LW_VBFA you will get the records statisfying your condition.

Thanks

KH


Read only

Former Member
0 Likes
1,403

Hi Joe,

Please try to use

Data: w_vbeln type vbfa-vbeln.

Clear Z_MAT_DOC_NO.

Select  VBELN FROM VBFA

into w_vbeln

WHERE VBELV = LIKP-VBELN

AND  VBTYP_N = 'R'.

Regards,

Prasenjit

Read only

arthur_alvesteixeira
Active Participant
0 Likes
1,403

Joe,

add SINGLE and INTO

CLEAR Z_MAT_DOC_NO.

SELECT SINGLE

       VBELN

  FROM VBFA

  INTO Z_MAT_DOC_NO

WHERE VBELV = LIKP-VBELN

   AND VBTYP_N = 'R'.

Read only

0 Likes
1,403

Thanks all

I have tried the following:

* Get the material document number

Clear Z_MAT_DOC_NO.

Select single VBELN

  FROM VBFA

INTO Z_MAT_DOC_NO

WHERE VBELV = LIKP-VBELN

AND  VBTYP_N = 'R'.

But no data is returned, I have checked the VBFA table and there is entry where VBELV matches LIKP-VBELN

Read only

0 Likes
1,403

Hi ,

Please check LIKP-VBELN and VBTYP_N = 'R' in VBFA table.

It might be  any good movement will not be available for this delivery.

Regards,

Prasenjit

Read only

0 Likes
1,403

Hi

I have checked and LIKP-VBELN and VBTYP_N = 'R' in VBFA table. is in table VBFA.

Do you think this has anything to do with my table join which does not have VBFA:

VIQMEL links to VBAK-VBAP-VBRP-VBRK-LIKP

if I have to add in VBFA where should this be added in the table join?

thanks

Joe

Read only

0 Likes
1,403

I have now removed the LIKP join as i do not think this is correct join, but  now I get the error message "LIKP-VBELN is uknown it is not in of the specified tables or defined by a data statement.

How would I define this in the data statement of the query, what would the data section of the query need to contain?

Read only

Former Member
0 Likes
1,403

Hi Joe ;

CLEAR : Z_MAT_DOC_NO.

SELECT SINGLE MATNR FROM VBFA

INTO Z_MAT_DOC_NO

WHERE VBELV = LIKP-VBELN AND

              VBTYP_N = 'R' .

Regards

Ă–zgĂĽn

Read only

Former Member
0 Likes
1,403

Hello Joe ,

Try this ,

DATA : Z_MAT_DOC_NO TYPE VBFA-VBELN .

CLEAR :Z_MAT_DOC_NO.

SELECT SINGLE   VBELN

                   FROM    VBFA

                      INTO   Z_MAT_DOC_NO

                 WHERE  VBELV = LIKP-VBELN

                        AND   VBTYP_N = 'R' .

~

Zuby Chakravorty

Read only

VenkatRamesh_V
Active Contributor
0 Likes
1,403

Hi Joe,

try this and see.

Clear Z_MAT_DOC_NO.

Select  VBELN FROM VBFA into table itab

WHERE VBELV = LIKP-VBELN

AND  VBTYP_N IN ( 'R' ).

Regards,

Venkat.