Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Issue in SELECT INTO

Hi

I am just learning ABAP. Review my example below. I have two questions.

1. How do I fix the syntax issue at "==>" in the below example.

2. No data getting populated at the field "??". in the below example.

What is the correct way to address this syntax issue.

Appreciate your help.

Example:

REPORT ZTST1.

TYPES:

BEGIN OF gy_product_class,

prvsy TYPE /sapsll/pntpr-prvsy,

prtxt TYPE /sapsll/prtxt,

lgreg TYPE /sapsll/prcon-lgreg,

congr TYPE /sapsll/prcon-congr,

attr01c TYPE /sapsll/prgen-attr01c,

attr10a TYPE /sapsll/prgen-attr10a,

attr10c TYPE /sapsll/prgen-attr10c,

attr10d TYPE /sapsll/prgen-attr10d,

attr10e TYPE /sapsll/prgen-attr10e,

attr40a TYPE /sapsll/prgen-attr40a,

attr40b TYPE /sapsll/prgen-attr40b,

attr40c TYPE /sapsll/prgen-attr40c,

attr40d TYPE /sapsll/prgen-attr40d,

attr40e TYPE /sapsll/prgen-attr40e,

attr20c TYPE /sapsll/prgen-attr20c,

stcts TYPE /sapsll/prcts-stcts,

lgreg_tlegsv TYPE /sapsll/tlegsv-lgreg,

srvll TYPE /sapsll/tlegsv-srvll,

ctsty TYPE /sapsll/tlegsv-ctsty,

exsid TYPE /sapsll/ctsnum-exsid,

ctsnum_stcts TYPE /sapsll/ctsnum-stcts,

ccngn TYPE /sapsll/ctsnum-ccngn,

?? guid_pr_prcts TYPE /sapsll/prcts-guid_pr,

?? guid_pr_prgen TYPE /sapsll/prgen-guid_pr,

guid_ctsnum TYPE /sapsll/ctsnum-guid_ctsnum,

?? guid_pr_prcon TYPE /sapsll/prcon-guid_pr,

?? guid_pr_pntpr TYPE /sapsll/pntpr-guid_pr,

END OF gy_product_class.

TYPES gy_t_product_class TYPE STANDARD TABLE OF gy_product_class.

DATA: lt_product_class TYPE gy_t_product_class,

lt_product_class_01 TYPE gy_t_product_class,

lt_product_class_02 TYPE gy_t_product_class,

lt_product_class_03 TYPE gy_t_product_class,

lt_product_class_04 TYPE gy_t_product_class,

lt_product_class_05 TYPE gy_t_product_class,

lt_product_class_06 TYPE gy_t_product_class,

lt_product_class_07 TYPE gy_t_product_class,

lt_product_class_08 TYPE gy_t_product_class.

.

DATA: itab_pntpr LIKE TABLE OF /sapsll/pntpr,

itab_prcon LIKE TABLE OF /sapsll/prcon,

itab_prcts LIKE TABLE OF /sapsll/prcts,

itab_tlegsv LIKE TABLE OF /sapsll/tlegsv,

itab_ctsnum LIKE TABLE OF /sapsll/ctsnum.

select *

INTO CORRESPONDING FIELDS OF TABLE itab_pntpr

from /sapsll/pntpr

where /sapsll/pntpr~prvsy = 'X320A'.

==>SELECT /sapsll/pntprprvsy /sapsll/prconguid_pr

==>INTO ( lt_product_class_06-prvsy, lt_product_class_06~guid_pr_prcon)

from /sapsll/pntpr

INNER JOIN /sapsll/prcts on /sapsll/prctsguid_pr EQ /sapsll/pntprguid_pr

INNER JOIN /sapsll/ctsnum on /sapsll/ctsnumguid_ctsnum EQ /sapsll/prctsguid_ctsnum

INNER JOIN /sapsll/prcon on /sapsll/prconguid_pr EQ /sapsll/prctsguid_pr

INNER JOIN /sapsll/tlegsv on /sapsll/tlegsvlgreg EQ /sapsll/prconlgreg

FOR ALL ENTRIES IN itab_pntpr

WHERE /sapsll/pntpr~guid_pr EQ itab_pntpr-guid_pr.

Tags:
Not what you were looking for? View more on this topic or Ask a question