Hello,
I'm new to object oriented programing.
I'm having problems using the IMPORT Syntax to read clusterdata from PCL4(LA) in a Global Class.
I've read all the documentation but can't find the solution or problem.
Let's give you my code.
In procedual code I've used:
INCLUDE: rpc4la00.
.....
SELECT srtfd aedtm uname
FROM pcl4
INTO CORRESPONDING FIELDS OF TABLE it_pcl4
WHERE relid = 'LA'
AND srtfd = 'A100119992006201803230946550001'. "Example
LOOP AT it_pcl4 INTO wa_pcl4.
MOVE wa_pcl4-srtfd TO lo-key.
IMPORT header belege FROM DATABASE pcl4(la) ID lo-key.
"Most of the stuff gets its definition from the include
ENDLOOP.
This works just fine. "header" and "belege" get's filled.
I can't use this type of coding in OO since it's obsolete and the include uses obsolete code as well.
So my OO-Code looks like this (simplified).
Data: gt_pcl4 TYPE TABLE OF pcl4,
gt_header TYPE TABLE OF pc403,
gs_header TYPE pc403,
gt_version TYPE TABLE OF pc402,
gt_belege TYPE TABLE OF pc404,
gs_belege TYPE pc404.
"Defining them since I can't use the include.
METHOD get_key_id.
SELECT srtfd
FROM pcl4
INTO CORRESPONDING FIELDS OF TABLE gt_pcl4
WHERE srtfd = 'A100119992006201803230946550001'.
------
METHOD import_header_belege.
MOVE iv_id TO gs_key. "which is gs_pcl4-srtfd.
All of the above works fine as well. The key is correctly filled.
Now to the syntax for importing the data.
I've used combinations of
DATA: wa TYPE pcl4.
IMPORT pc403 = gt_header FROM DATABASE pcl4(la) TO wa ID gs_key.
IMPORT pc403 = gs_header FROM DATABASE pcl4(la) TO wa ID gs_key.
The only thing that gets filled is "wa"
Edit: see:

Can anyone explain why gt_header is not getting filled with the data from the database?
Maybe not using the syntax correctly?
As I've said the procedual coding works.
Thank you in advance.
Add comment