SAP-Forum.ORG
   
This web site isn't affiliated with, sponsored by, or approved by SAP AG. Is only a SAP users community.

Go Back   SAP-Forum.ORG > SAP Forums > SAP ABAP

Similar Threads
Thread Thread Starter Forum Replies Last Post
Internal Order Settlement to Cost Center and GL account. Micro SAP FI CO - Financials and Controlling 3 01-31-2011 11:55 PM
Internal Order Settlement. SAPMM SAP FI CO - Financials and Controlling 1 01-20-2011 04:12 PM
Settlment of Internal Orders into COPA Segment and Cost Center Micro SAP FI CO - Financials and Controlling 3 11-19-2010 11:37 PM
REUSE_ALV_LIST_DISPLAY' Field symbol has not yet been assigned Gurla SAP ABAP 1 05-25-2010 04:09 PM
Updating a field using the FUNCTION 'REUSE_ALV_GRID_DISPLAY' Rival SAP ABAP 4 05-18-2010 08:23 PM

Aprenda SAP!
Reply
 
Thread Tools Display Modes
  #1  
Old 02-27-2011, 12:14 AM
Zumba Zumba is offline
Senior Member
 
Join Date: May 2010
Location: Colorado
Posts: 239
Default internal table and field symbol

Hi,

I have internal table it_tab with below data

"-----internal table it_tab data

plant -- matnr -- menge
1001 -- 0098102455 -- 100
1002 -- 0098102455 -- 200
1003 -- 0098102455 -- 50
1001 -- 0098100005 -- 50
1002 -- 0098100005 -- 10
1003 -- 0098100005 -- 6

I have created dynamic table <FS_TABLE> using field-symbol

I want to put the data from it_tab to <FS_TABLE> as shown below

Matnr ________ plant_1001_qty -- plant_1002_qty-- plant_1003_qty
0098102455 _____ 100 ____________ 200 ____________ 50
0098100005 _____ 50 _____________ 10 _____________ 6

Please help me out

Regards,
Zumba
Reply With Quote
Sponsors
  #2  
Old 02-27-2011, 12:15 AM
Portal Portal is offline
Senior Member
 
Join Date: May 2010
Location: Miami
Posts: 789
Default Re: internal table and field symbol

Hi Zumba,

Use control break statements.
Sort itab by matnr and at new matnr build a new itab with whatever fields you need.

Cheers!

Portal
Reply With Quote
  #3  
Old 02-27-2011, 12:16 AM
Golfi Golfi is offline
Senior Member
 
Join Date: May 2010
Location: Delaware
Posts: 826
Default Re: internal table and field symbol

As u have created a dynamic internal table <FS_TABLE>, hope the internal table contains fields with plant names.

You can populate the values into the table using the below logic.

DATA: field_name(40).

sort it_tab_data with matnr.

*--loop the table with final entries for display

LOOP AT it_tab_data INTO fs_data

*---When record with particular material number ends append the entries from work area

ON CHANGE OF fs_data-matnr.
IF NOT <fs_line> IS INITIAL.
APPEND <fs_line> TO <fs_table>.
CLEAR <fs_line>.
ENDIF.
*---Material Number

CONCATENATE '<fs_line>-' 'MATNR' INTO field_name.
ASSIGN (field_name) TO <fs_field>.

IF sy-subrc = 0.
<fs_field> = fs_data_f-matnr
ENDIF.

*---Plant name like in your example 1001, 1002

CONCATENATE '<fs_line>-' fs_data-plant_name INTO field_name.
ASSIGN (field_name) TO <fs_field>.

IF sy-subrc = 0.
<fs_field> = fs_data-gmnga. "qty
ENDIF.

ENDLOOP.

Hope the logic will help you.

Regards,
Golfi
Reply With Quote
Entre a los Links relacionados
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:10 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Forum Design By inferno