cancel
Showing results for 
Search instead for 
Did you mean: 

Internal Table Mapping

Former Member
0 Kudos

Dear Experts,

I am using one internel table namely, it_mseg. inside values in

matnr,erfmg. another internal table is it_mbew. in side the values in

matnr,verpr. Actually I am print the Values matnr,verpr erfmg in smartforms.in table format.

How to Join all the three fields in single internal table for it_mbew internal table. PLZ Help Me.

I am draw One table in smartforms. But how to print the table format in it_mbew.field values.

PLZ help me. MY first smartforms.

Thanks & Regards,

Raj.A

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

After praparing final internal table, pass it to your samrt form call. (you can follow the previous reply)

(In Smartforms, you have to declare a similar internal table)

Then, in SF you can refer this internal table in data tab of tables. (Below to Loop)

If you have work area similar to internaltable, you can write the values at appropriate colums, using WA_it-filedname. You have to give it in text area created for every cell.

Muthukumar.Ram

Answers (4)

Answers (4)

Former Member
0 Kudos

Your both it_mseg and it_mbew may have multiple lines for the same matnr. How do u wish to correlate them and put into the Third table has to be clear.

Either use Nested loops like:

Loop at it_mseg.

Loop at it_mbew where matnr = it_mseg-matnr.

  • fill all 3 relevant fields

APPEND it_new_tab.

Endloop.

Endloop.

Or you may use Read Table instead of second loop.

This should however be used only if there is one entry in it_mbew per matnr.

Loop at it_mseg.

READ TABLE it_mbew WITH KEY matnr = it_mseg-matnr.

APPEND it_new_tab.

Endloop.

tarangini_katta
Active Contributor
0 Kudos

Hi,

write like this.

types : begin of ty_final,

matnr,

erfcg,

verpr,

end of ty_final.

select matnr erfcg from mseg into table it_it_mseg.

select matnr verpr from mbew into table it_mbew for all entries in it_mseg where matnr = it_mseg-matnr.

loop at it_mseg into wa_mseg.

read table it_mbew into wa_mbew with ky matnr = wa_mseg-matnr.

wa_final-matnr = wa_mbew-matnr.

wa_final-erfcg = wa_mseg-erfcg,

wa_final-verpr = wa_mbew-verpr.

Thanks,

apend wa_final into to it_final.

clear wa_final.

endloop.#

Former Member
0 Kudos

HI tarangini katta,

Thanks for ur info.But Last value only Updated in final internal table.

i need all the values.

For Eg: 7 matnr will be availabe in IT_mseg.

each matnr get diff erfmg and stprs and verpr.

reply me

regards,

raj

Former Member
0 Kudos

Hi,

Two things to add...

1) while using select statement with for all entries use the check that

if it_mseg is not initial.

sort table it_mseg and

delete duplicate enteries ( if you dont want)..

2) please loop the internal table which hold the line item details...

ex : if it_mbew is the line item detail table

loop at it_mbew

read it_mseg..

Hope this will help.

Regards,

Rohan.

Edited by: Rohan on Dec 5, 2008 11:18 AM

Former Member
0 Kudos

hi soosai,

first you fetch and put the required fields from both the tables by reading it in another internal table..

give that internal table format same as that of it_mbew..

then use that internal table for your output..

regards,,

nikita

former_member235056
Active Contributor
0 Kudos

Hi,

Use the third table and combine the two tables and then feed it in smartforms.

Regards,

Ameet