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

Mapping Line type Data to table data

Former Member
0 Likes
935

Hi,

I am trying to refer to a data element present in the line type of a table type which belongs to an import parameter of a smartform. How will i access the data element to use in the where clause of a select statement.

For Eg:

Import Parameter name: PARTNER_H

TYPE: CRMT_OUTPUT_PARTNER_H_COMT (table type)

The line type attached to this table type is CRMT_OUTPUT_PARTNER_H_COM.

This line type is the structure that contains the data element that i need to use. the details are as below:

Component: RELATION_PARTNER

Component type: BU_PARTNER_GUID

I have written a select statement as below:

SELECT SINGLE * from BUT000 into I_FS_BUT000 where

PARTNER_GUID = PARTNER_H-RELATION_H.

I have given the input parameter as PARTNER_H.

It throws me an error that "PARTNER_H" is a table without a header line and therefore has no component called "RELATION_H".

Is this the correct way to access the data element?Please help.

2 REPLIES 2
Read only

Former Member
0 Likes
617

Hi Neena,

Since PARTNER_H is an internal table it may have multiple values. If you want only a single entry from BUT000, you ll have to determine which entry from PARTNER_H you need in select query.

If it is always going to have only a single value then , this will work :


data: wa_partner_h type line of CRMT_OUTPUT_PARTNER_H_COMT.

Read table partner_h into wa_partner_h index 1.

if sy-subrc is initial.

SELECT SINGLE * from BUT000 into I_FS_BUT000 where
PARTNER_GUID = WA_PARTNER_H-RELATION_H.

endif.

Regards,

Arun

Read only

Former Member
0 Likes
617

Neena,

declaring a variable of type Table type makes it a table...

so need to have a work area for this, or use select with for all entries..

with workarea how to proceed, the earlier post is already showing you the code

and with FOA:

data : lt_but000 type table of but000.
SELECT * from BUT000 into table lt_BUT000 
For all entries in PARTNER_H "==>FOA
where PARTNER_GUID = PARTNER_H-RELATION_H.