Skip to Content

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

Problem in SELECT statement

When I write:

SELECT GUID PROJECT_ID

into corresponding fields of table itab

from DPR_PROJECT.

It returns a 32-char GUID code instead of a 24-char GUID! The first 24 chars are the correct GUID. But the additional last 8 chars should not be there.

When I try to use a 24-char data-element instead of the std data element, it throws a dump saying that the source and target fields are incompatible.

Can anyone help?

Thanks

Prasad

Former Member
Former Member replied

HI,

Check this code..

Declaration of ZBAPI_PROJECTID_PROJECTNAME structure 
GUID	Data element DPR_TV_ENTITY_GUID
PROJECT_ID	Data element TYPE DPR_TV_PROJECT_ID
TEXT1	Data element CGPL_TEXT1

*"----------------------------------------------------------------------
*"*"Local Interface:
*"  TABLES
*"      ZTAB STRUCTURE  ZBAPI_PROJECTID_PROJECTNAME
*"----------------------------------------------------------------------
  DATA itab TYPE zbapi_projectid_projectname OCCURS 0 WITH HEADER LINE.

  SELECT guid project_id
    INTO CORRESPONDING FIELDS OF TABLE itab
    FROM dpr_project.

*Get all project names
  LOOP AT itab.

    SELECT text1
      INTO itab-text1
      FROM cgpl_text WHERE guid EQ itab-guid.
    ENDSELECT.

    MODIFY itab.

  ENDLOOP.

  ztab[] = itab[].

0 View this answer in context

Helpful Answer

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