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

Data Fetching Problem

Former Member
0 Likes
1,327

Dear Experts,



TYPES : BEGIN OF t_afko,
          aufnr LIKE afko-aufnr,
          gstrp LIKE afko-gstrp,
          gltrp LIKE afko-gltrp,
          ftrmi LIKE afko-ftrmi,
          getri LIKE afko-getri,
          aufpl LIKE afko-aufpl,
          rsnum LIKE afko-rsnum,         
        END OF t_afko.


DATA : i_afko TYPE STANDARD TABLE OF t_afko
       INITIAL SIZE 0 WITH HEADER LINE.


SELECT-OPTIONS : s_aufnr FOR afko-aufnr ,
                               s_gstrp FOR afko-gstrp .


SELECT
        aufnr
        ftrmi                                      " Release Date
        gltrp                                      " Actual Finish Date
        gstrp                                      " Actual Start Date
        getri                                      " Confirmed Order Finish Date
        aufpl                                      " Routing number of operations in the order
        rsnum                                      " Reservation Number
        INTO CORRESPONDING FIELDS OF TABLE i_afko
        FROM afko
        WHERE aufnr IN s_aufnr.

But when i execute this code, nothing comes in internal table although data exist in afko.

Can anyone tell me whats wrong with the code.

Regards,

Maverick

9 REPLIES 9
Read only

Former Member
0 Likes
1,127

not sure why data not coming but do some modifications and try..

TYPES : BEGIN OF t_afko,
"make this as the same order as in database table
          aufnr TYPE afko-aufnr,
          gstrp TYPE afko-gstrp,
          gltrp TYPE afko-gltrp,
          ftrmi TYPE afko-ftrmi,
          getri TYPE afko-getri,
          aufpl TYPE afko-aufpl,
          rsnum TYPE afko-rsnum,         
        END OF t_afko.

 
DATA : i_afko TYPE STANDARD TABLE OF t_afko.
"       INITIAL SIZE 0 WITH HEADER LINE.
 
 
SELECT-OPTIONS : s_aufnr FOR afko-aufnr ,
                               s_gstrp FOR afko-gstrp .
 
 
SELECT
"make this as the same order as in database table
        aufnr
        ftrmi                                      " Release Date
        gltrp                                      " Actual Finish Date
        gstrp                                      " Actual Start Date
        getri                                      " Confirmed Order Finish Date
        aufpl                                      " Routing number of operations in the order
        rsnum                                      " Reservation Number
"        INTO CORRESPONDING FIELDS OF TABLE i_afko
        FROM afko
        INTO TABLE i_afko 
        WHERE aufnr IN s_aufnr.

maintain order as :

AUFNR

GLTRP

GSTRP

FTRMS

GETRI

GLTRI

accordingly..

Edited by: Soumyaprakash Mishra on Sep 16, 2009 12:05 PM

Edited by: Soumyaprakash Mishra on Sep 16, 2009 12:07 PM

Read only

0 Likes
1,127

Thanks for your reply

but could u please explain the reason.

Still no data is coming into internal table

Regards

Maverick

Read only

0 Likes
1,127

put a break point on select statement. and check the sy-subrc

by the way..

are you passing any thing to s_aufnr ??

Read only

0 Likes
1,127

Thanks dear

But i hv already checked is with break point.

And I m not passing anything to s_aufnr.

Regards,

Maverick

Read only

0 Likes
1,127

Hi Maverick, <li>Try the below code. If you find records in i_afko, then some problem with where condition


REPORT ZTEST_NOTEPAD.
TABLES AFKO.
TYPES : BEGIN OF T_AFKO,
         AUFNR LIKE AFKO-AUFNR,
         GSTRP LIKE AFKO-GSTRP,
         GLTRP LIKE AFKO-GLTRP,
         FTRMI LIKE AFKO-FTRMI,
         GETRI LIKE AFKO-GETRI,
         AUFPL LIKE AFKO-AUFPL,
         RSNUM LIKE AFKO-RSNUM,
       END OF T_AFKO.
DATA:  W_AFKO TYPE T_AFKO.
DATA : I_AFKO TYPE STANDARD TABLE OF T_AFKO.
*      INITIAL SIZE 0 WITH HEADER LINE.
SELECT-OPTIONS : S_AUFNR FOR AFKO-AUFNR ,
                 S_GSTRP FOR AFKO-GSTRP .

START-OF-SELECTION.
  SELECT
         AUFNR
         FTRMI                                      " Release Date
         GLTRP                                      " Actual Finish Date
         GSTRP                                      " Actual Start Date
         GETRI                                      " Confirmed Order Finish Date
         AUFPL                                      " Routing number of operations in the order
         RSNUM                                      " Reservation Number
         INTO CORRESPONDING FIELDS OF TABLE I_AFKO
         FROM AFKO UP TO 10 ROWS.
  "WHERE AUFNR IN S_AUFNR.

  BREAK-POINT.
Thanks Venkat.O

Read only

venkat_o
Active Contributor
0 Likes
1,127

Hi Maverick, <li>Code seems to be pretty okay. Better to go SE16 and check data for AFKO whether table has data or not ? Thanks Venkat.O

Read only

Former Member
0 Likes
1,127

Thanks Venkat.O

but i hv checked , data exist in the table.

any suggestion.

Regards

Maverick

Read only

Former Member
0 Likes
1,127

Hi,

Check if any conversion exit is associated with the field afko-aufnr. For testing purpose append zeros and give the exact length of the field in the select option and check if the internal table is filled.

Regards,

Vikranth

Read only

Former Member
0 Likes
1,127

pls check this code

tables : afko.

TYPES : BEGIN OF t_afko,

aufnr LIKE afko-aufnr,

gstrp LIKE afko-gstrp,

gltrp LIKE afko-gltrp,

ftrmi LIKE afko-ftrmi,

getri LIKE afko-getri,

aufpl LIKE afko-aufpl,

rsnum LIKE afko-rsnum,

END OF t_afko.

DATA : i_afko TYPE STANDARD TABLE OF t_afko

INITIAL SIZE 0 WITH HEADER LINE.

SELECT-OPTIONS : s_aufnr FOR afko-aufnr ,

s_gstrp FOR afko-gstrp .

SELECT

aufnr

ftrmi " Release Date

gltrp " Actual Finish Date

gstrp " Actual Start Date

getri " Confirmed Order Finish Date

aufpl " Routing number of operations in the order

rsnum " Reservation Number

INTO CORRESPONDING FIELDS OF TABLE i_afko

FROM afko

WHERE aufnr IN s_aufnr.

write : 'hi'.