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

Datasource as a FM

manukapur
Active Participant
0 Likes
677

Hi Experts,

I am trying to create a FM which will serve as a datasource for BW.  I created a structure for the output and using it my FM.

My select query is a join from different tables and I am fetching a field OBJID from different tables. When I am trying to populate the E_T_Data structure in the datasource, it is only poplulating fields with the same name in query.

I am fetching objid's from different tables and my output structure has fields with different names for it.

The other fields are not populating.

My select query is

       select

         t1~objid

         t2~objid

         t2~smlevycat

         t3~objid

         t3~seccat1

         t4~begda

         t4~peryr

         t4~perid

         t5~knumh

         t5~kschl

         t6~kbetr

         t6~konwa

     from  hrp1742 as t2

           inner join hrp1001 as t1 on t2~objid = t1~sobid  and t1~mandt = t2~mandt

           inner join hrp1743 as t3 on t3~objid = t1~objid and t3~mandt = t1~mandt

           inner join hrp1739 as t4 on t4~objid = t1~objid and t4~mandt = t1~mandt and t4~mandt = t3~mandt

           inner join a913    as t5 on t5~kschl = t2~smlevycat and t5~cmsmsecat1 = t3~seccat1 and t5~mandt = t2~mandt and t5~mandt = t3~mandt and t5~cmperid = t4~perid and t5~cmperyr = t4~peryr

           inner join konp    as t6 on t6~knumh = t5~knumh and t6~mandt = t5~mandt and t6~kschl = t2~smlevycat

     where

           t1~otype = 'SE' and

           t1~sclas = 'SM' and

           t1~plvar = '01' and

           t2~otype = 'SM' and

           t2~plvar = '01' and

           t3~otype = 'SE' and

           t3~plvar = '01' and

           t4~plvar = '01' and

           t4~otype = 'SE' and

           t1~objid in l_r_epid  and

           t2~objid in l_r_modid and

           t2~smlevycat in l_r_scat and

           t3~seccat1 in l_r_sect1 and

           t4~begda in l_r_begda and

           t4~peryr in l_r_ayear and

           t4~perid in l_r_asess  and

           t5~datbi ge sy-datum and  "Validity End Date

           t5~datab le sy-datum.     "Validity Start Date

and the output structure is as follows

The two fields objid_m and objid_se are not populating.

What shall I do to populate these two fields?

Regards,

Manu

1 ACCEPTED SOLUTION
Read only

manukapur
Active Participant
0 Likes
643

Solved. Used addition as in the query .

E.g.

select

         t1~objid

         t2~objid as objid_m

         t2~smlevycat

         t3~objid as objid_se

It worked.

Regards,

Manu

Solved. Used addition as in the query .

E.g.

select

         t1~objid

         t2~objid as objid_m

         t2~smlevycat

         t3~objid as objid_se

It worked.

Regards,

Manu

1 REPLY 1
Read only

manukapur
Active Participant
0 Likes
644

Solved. Used addition as in the query .

E.g.

select

         t1~objid

         t2~objid as objid_m

         t2~smlevycat

         t3~objid as objid_se

It worked.

Regards,

Manu