Assigning fields(data) to field symbos of table
Hi All,
Though there is lot of material available on the concept of field symbols I could not apply the logic of it to my problem. Hence posting this query.
I am creating dynamic internal table and want to populate that internal table with other itab.
i have created Field symbols now how to populate the part of the other itab to field symbols which
points to other itab.
My code is like
data : p_intab LIKE dfies-tabname .
data : begin of wbs occurs 0,
wbs type c,
objnr type proj-objnr,
end of wbs.
FIELD-SYMBOLS :
<fs_tab> LIKE LINE OF tab_info,
Output Structure****
<it_disptab> TYPE table .
p_intab = fieldcatalog.
ASSIGN p_intab TO <fs_tab>-tabname .
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = <fs_tab>-tabname
CHANGING
ct_fieldcat = it_grid_fcat.
*Creating internal table
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_grid_fcat
IMPORTING
ep_table = dref.
ASSIGN dref->* TO <it_disptab>.
PERFORM populate_grid_data .
CALL METHOD grid->set_table_for_first_display
EXPORTING
is_layout = struct_grid_lset
CHANGING
it_outtab = <it_disptab>
it_fieldcatalog = it_grid_fcat
. " Period
form populate_grid_data.
*i want to populate the fields of dynamic internal table <it_disptab>
with wbs
endform.
*once i display it to user he will edit the values that i want to save it back to transperant table from fields symbols <it_disptab>.
Best Regards
Sandeep
Hi Sandeep,
within your form routine you can do the following:
form populate_grid_data.
*i want to populate the fields of dynamic internal table <it_disptab>
with wbs
1. create work area for your table
data: l_lineref type ref to data.
field-symbols: <l_line> type any.
create data l_lineref like line of <it_disptab>.
assign l_lineref->* to <l_line>.
case you have identical named fields
move corresponding wbs to <l_line>.
append <l_line> to <it_disptab>.
case the fieldnames are different
field-symbols: <fs_target1>,
<fs_target2>.
assign component 'Fieldname' of structure <l_line>
to <fs_target1>.
<fs_target1> = wbs-wbs.
assign component 'Fieldname' of structure <l_line>
to <fs_target2>.
<fs_target2> = wbs-objnr.
append <l_line> to <it_disptab>.
endform.
Hope it helps.
regards
Siggi
Similar Messages
-
Activation error while changing the data type of a field of a table
hi friends,
i am facing one problem while changing a data type of a field of a table.
i just created one table(Yqm32) .i have assigned charcter data type to one field(ztotal_count) .now i want to change this charcter data type to numeric data type.
while changing to NUMC data type activation error is comming as below.
Table is not yet classified
Field ZTOTAL_COUNT: Type change
ALTER TABLE is not possible
Structure change at field level (convert table YQM32)
Check on table YQM32 resulted in errors
Table YQM32 could not be activated
(E- Structure change at field level (convert table YQM32)
plz suggest.i need to change the data type from char to numc.
Thanks & RegardsHi Pabitra......
From the SE11 change the table as u wanted and then from menubar select
UTILITIES--> DATABASE UTILITY
It will open database utility
there u select the Activate and adjust database button.
then the database table will get adjusted.
just try it once.........
Suresh...... -
Assign function code to a field in internal table
Hi all,
Can we assign a function code to one field in internal table so that we can use it as an user command in list display.
For ex:
data : begin of itab occurs 0,
check(1) type C,
num type I,
end of itab.
I am preparing a list display using WRITE statements.
I'ld like to update the checked value of check box as soon as the user selects a check box. So I would like to assign a function code to this check box. Then I can use AT user-command.Hi,
dinesh's apporach is not bad, but
1. the structure' name cannot be part of the component
2. you need to make sure the component-name always is in upper case.
Try adapting the following code:
data: begin of wa_test,
field01 type string,
field02 type string,
field03 type string,
end of wa_test.
data: l_fieldname type string,
l_counter type string.
field-symbols: <testc> type string.
do 3 times.
l_counter = sy-index.
concatenate 'field0' l_counter into l_fieldname.
translate l_fieldname to upper case.
assign component l_fieldname of structure wa_test to <testc>.
if <testc> is assigned.
<testc> = 'any value'.
endif.
enddo.
write / wa_test-field01.
best regards -
It is possible to assign value range to non key fields in the table?
Hi,
I want to give some range of values to the fields which are non key fields in the table.
is it possible?
can anybody tell me the procedure.
Thanks in Advance,
venkatHI,
It is higjly possible in case of Z-table. but in standard table you can't make any modification.
You assign the value range to the domain of field.
go to SE11 and open the database table.
Select the Data Element of the fieldto which you want assign the range.
Click on its domain .
click on Value Range tab.
Set the range.
Regards,
anirban -
Changing the attibutes of a field in the table will affect existing data
Hi Experts,
If I want to changne the field attribute of particular field in the table, this table whoes field is changed is used in 15 more tables.Will that affect the data in production after changing the field attributes in all the 15 tables.
Thanks in Advance.
Regards,
IFFHi,
Definitely data will effect in all tables and also you have to modify all the programs which are used modified tables.
Regards,
Peranandam -
How to Read data from a table which is defined as a field in another table
Hi
Iam working with FM: 'CUCB_GET_CONFIGURATION'
<b> Import parameter configuration as a table.</b>
<u>but configuration has another table as a field.</u>
i want to read the inner table fields.
how can i read the table which is defined as field in configuration table.
Please try to give me a solution.
can i have the declartions too....
Thanks,
sriHi jonnakuti,
1. simple
2.
DATA : CONFG TYPE IBCO2_INSTANCE_TAB2.
<b>DATA : WA TYPE LINE OF IBCO2_INSTANCE_TAB2.</b>
3. just copy paste
4.
report abc.
TYPE-POOLS : IBCO2.
DATA : INSTANCE TYPE CUIB_CUOBJ.
DATA : CONFG TYPE IBCO2_INSTANCE_TAB2.
DATA : WA TYPE LINE OF IBCO2_INSTANCE_TAB2.
CALL FUNCTION 'CUCB_GET_CONFIGURATION'
EXPORTING
INSTANCE = INSTANCE
IS_BUSINESS_OBJECT =
IV_MOMENT =
IV_WITH_DB_INSTANCE =
IMPORTING
IBASE =
CONFIGURATION = CONFG
EO_CBASE_REF =
EXCEPTIONS
INVALID_INPUT = 1
INVALID_INSTANCE = 2
INSTANCE_IS_A_CLASSIFICATION = 3
OTHERS = 4
read like this
LOOP AT CONFG INTO WA.
ENDLOOP.
regards,
amit m. -
Problem while saving date field in custom table
Hi,
Iam facing the following problem while saving a date field in custome table
i have a date field zdate in which the value is 02082010.
now when i try to insert this value in the custom table it is getting updated as 20/10/0208 , but it should be 08/02/2010
How can i correct it..
Regards
Kumarjust before saving u might have to use a string reverse FM and then save it..
CALL FUNCTION 'STRING_REVERSE'
EXPORTING
STRING = p_string
LANG = sy-langu
IMPORTING
RSTRING = r_string
EXCEPTIONS
TOO_SMALL = 1
OTHERS = 2 -
Problem with displaying Date field in the table.
Hi All,
I am trying to display data into a table UI Element.
In that data, i have one DATE type field. While displaying data in DATE field, it will display like this "01.02.2009".
Now my requirement is if i want to modify that DATE field, it will allow to modify "01.02.2009" to "26.02.2009".
But while modifying DATE field , I want to show the Calender of that month, in that i have to select the another date.
(Like normal Date UI Element will show that calender).
Can anyone please help me.
Thanks in Advance!
Regards,
Sreelakshmi.Hi,
Go to the context attribute that was mapped to the DATE field of the table and change the perperty INPUT HELP MODE to AUTOMATIC and it works.
Regards,
Manne. -
Issue with Vendor Master Data-field notes ID (Table ADRT-REMARK)
Hello,
I have a issue related to Vendor Master Data maintenance.
The client wants to maintain the u201CNotesu201D field in vendor master data. The field gets populated from the field u201CADTR-REMARKu201D table ADRT.
Now client wants to maintain some alphabet to distinguish some of vendors (i.e. 1250) out of 5000 vendors. We tried to develop LSMW, however it is not getting generated as this field is not getting recorded as the field is inside the tab (next to e-mail id field) which requires click. It seems BDC also is also not working as it is not populating these fields except e-mail id.
The table ADRT contains filed ADDRNUMBER which is the same field in LFA1, and it is ADRNR (Address number).
Also please note that CATT/e CATT is not permitted at all the client level.
Can any body suggest the way to change the master data through some way.
Regards,
ChepanHi,
Did you heard about SAP GUI Scripting? There is SAP functionality - seems to Excel Macros. You are able to record SAP like macros, then after small code modifcation (code is in Visual Basic), and special excel origin (there could be excel prepared like for CATT) upload data to VMD.
If you have any questions I try to help you?
Best regards,
Piotr
Edited by: Piotr Wieczerzak on Jan 26, 2010 9:35 PM -
Adding fields to database table and copying data from other fields
Hi All,
I am having a database table where in I am having a column 'FIELD1'.
My requirement is that I want to add two more fields in the table 'FIELD2' and 'FIELD3'.
I then want to copy all the data in field1 to field2 and field3. then I want to delete the original field1.
for Ex.
lets say FIELD1 = 100.
now I want to add FIELD2 and FIELD3 in the table and make FIELD2 = 100 AND FIELD3 = 100. The FIELD1 will be deleted from table.
Please suggest the methods to do so.
It is urgent.Hi Gaurav,
do this way ...
data : begin of it_ztab occurs 0 with header line,
fld1 like ztab-fld1,
fld2 like ztab-fld2,
fld3 like ztab-fld3,
end of it_ztab.
data : wa_ztab like it_ztab.
it_ztab-fld1 = '100'.
append it_ztab.
clear it_ztab.
loop at it_ztab.
wa_ztab-fld2 = it_ztab-fld1.
wa_ztab-fld3 = it_ztab-fld1.
wa_ztab-fld1 = ' '.
* Make sure that the structure of internal table/ workarea and database table shoud be same
modify ztab from wa_ztab.
endloop. -
How to print the data if we take different fields from diffrent tables
Hi ABAPers,
I take diff fields from 3 tables. Those are
these fields from EKBE
EBELN
EBELP
BELNR
BUZEI
BWART
BUDAT
AREWR
REEWR
WERKS
MWSKZ
these fields from EKKO
BUKRS
BSART
WAERS
these field from EKPO
TXZ01
MATNR
MTART
I want to print the data all fields.What logic can i write?
Please help me for this question and i am waiting for your response.
Regards,
Raja Sekhar.Hi,
First you have to fetch data from all the three tables and then consolidate into final table.
In Declaration:
1.Declare Internal Table for EKKO holding:
EBELN
BUKRS
BSART
WAERS
2.Declare Internal Table for EKPO holding:
EBELN
EBELP
TXZ01
MATNR
MTART
3.Declare Internal Table for EKBe holding:
EBELN
EBELP
BELNR
BUZEI
BWART
BUDAT
AREWR
REEWR
WERKS
MWSKZ
*==> This table has
MANDT
EBELN
EBELP
ZEKKN
VGABE
GJAHR
BELNR
BUZEI
as Primary keys field,you should have values for all the PK aotherwise you will get multiple entries*
4.Declare a Final Internal Table i_final with all the fields you want
EBELN
EBELP
BUKRS
BSART
WAERS
TXZ01
MATNR
MTART
BELNR
BUZEI
BWART
BUDAT
AREWR
REEWR
WERKS
MWSKZ
Data Fetching
select EBELN
BUKRS
BSART
WAERS
from EKKO
into table i_ekko
where .........<selection criteria>.
if not i_ekko is initial.
select EBELN
EBELP
TXZ01
MATNR
MTART
from EKPO
into table i_ekpo
for all entries in i_ekko
where EBELN = I_EKKO-EBELN
AND ......<If any other selection criteria>.
if not i_ekpo is initial.
select EBELN
EBELP
BELNR
BUZEI
BWART
BUDAT
AREWR
REEWR
WERKS
MWSKZ
from EKBE
into table i_ekbe
for all entries in i_ekpo
where ebeln = i_ekpo-ebeln
and ebelp = i_ekpo-ebelp
and ..........<If any othet selection criteria>
endif.
endif.
Consolidate
sort i_ekko by ebeln.
sort i_ekpo by ebeln ebelp.
sort i_ekbe by ebeln ebelp.
LOOP AT i_ekbe into wa_ekbe.
read table i_ekko into wa_ekko with key ebeln = wa_ekbe-vbeln binary search.
if sy-subrc = 0.
====>Move all the required firlds from I_EKKO to i_final , like
wa_final-BUKRS = wa_ekko-BUKRS.
endif.
read table i_ekpo into wa_ekpo with key ebeln = wa_ekbe-vbeln
ebelp = wa_ekbe-ebelp binary search.
if sy-subrc = 0.
====>Move all the required firlds from I_EKPO to i_final , like
wa_final-EBELP = wa_ekko-EBELP.
wa_final-TXZ01 = wa_ekko-TXZ01.
endif.
==>Also all the required fields from EKBE to final table, like
wa_final-BELNR = wa_ekbe-BELNR.
endloop. -
Assignment field(ZUONR) data at clearing
Hello Experts,
I have a question on the assignment field(ZUONR) when I do the clearing for 2 open items.
I have 2 open items for a certain customer, one is an account receivables and another a down payment for customer.
And above 2 open items have a certain data at each assignment field(ZUONR) to identify each open item.
I'd like to clear above 2 items, so I go into the transaction FB05, select 2 items and simulate that document.
At that time, when I look into each line item, there is no data at each assignment field even though the original document has a certain data at each assignment field.
Namely, each assignment field is all blank.
I wish the clearing document has the data at each assignment field that the original document has.
Is there anyone who can solve this issue?
Thanks.
BR,
ChrisHi,
In order to populate same assignment field (ZUONR) in both the documents Sort Key should be same in the G/L master.
You can try following Sort keys
1. 031 Customer number
2. 024 Document header text
Else you can create your own sort key through transaction code OB16.
In this give
1. Sort key in Enter Sort key
2. Enter Description - In this enter description of Sort Key.
3. Enter Field1 - In this enter field name.
Hope your issue is resolved else revert.
Regards,
Tejas -
Moving data from custom fields to ekko table
Hi Experts,
I added new custom tab into me21n,me22n,me23n header thro me_gui_po_cust and me_process_po_cust.
If i enter values in my custom fields, transport_from_model this method is not triggering.i have written below code in this method.
METHOD if_ex_me_gui_po_cust~transport_from_model.
DATA: l_header TYPE REF TO if_purchase_order_mm,
ls_mepoheader TYPE mepoheader,
ls_customer TYPE ci_ekkodb.
CASE im_name.
WHEN subscreen.
mmpur_dynamic_cast l_header im_model.
CHECK NOT l_header IS INITIAL.
ls_mepoheader = l_header->get_data( ).
CALL FUNCTION 'ZMM_GET_DATA'
EXPORTING
im_ebeln = ls_mepoheader-ebeln
* im_ebelp = ls_mepoheader-ebelp
IMPORTING
ex_data = ls_customer .
MOVE-CORRESPONDING ls_mepoheader TO dynp_data_pbo.
MOVE ls_customer-ztender TO dynp_data_pbo-ztender.
MOVE ls_customer-zemdapplicable TO dynp_data_pbo-zemdapplicable.
MOVE ls_customer-zpbgapplicable TO dynp_data_pbo-zpbgapplicable.
MOVE ls_customer-zemdamount TO dynp_data_pbo-zemdamount.
MOVE ls_customer-zemdvalidity TO dynp_data_pbo-zemdvalidity.
WHEN OTHERS.
ENDCASE.
ENDMETHOD.
i cant move my values entered in custom fields to ekko table.
please help if u know..
regards,
Kavitha
Edited by: Matt on Mar 23, 2011 10:55 AM added tagsHi,
check this out.. !!
Import data from Excel to Oracle Database and
Added link From Ask Tom.. your requirement you would be satisfied.. I supppose.. !!
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:908428873069
- Pavan Kumar N -
To Display a date field in TSTCT table
Dear Experts,
Recently we got a request to have a date field in TSTCT table. So, that when ever the new transaction is created the date will automatically display in TSTCT table. Now there is only three fields in the table. There is no further settings to regarding the display of date field. Is there any possible cases/BADI's which helps to display the Date field in TSTCT Table. Please help me with possible solutions.
Thanks in advance, Regards,
Harsha.Dear Eswara,
It is not possible adding field through BADI or exit. But you go into /nSE11 for this table and go to Technical Settings, if the check box 'Log Data Changes' is set then you may be able to display a log of changes made to entries in this table using /nSCU3.
Regards,
Abbas. -
Hi There,
In SAP GRC 10.0, our team had an issue where we could not add duplicate fields from separate table (see ERROR: Select Currency/UoM field for the selected analyzed fields). This was resolved by the SAP Note 1904313/ 1904314 (http://service.sap.com/sap/support/notes/1904313).
We upgraded our system to SAP GRC 10.1 SP05 and could now add the duplicate fields from separate tables. SAP Note 1904313/ 1904314 was part of SAP GRC 10.1 SP03 so it makes sense that we, in a higher version (SP05), would be able to do this.
The issue now is when we add the duplicate fields from different tables and run the Ad-hoc Query to test if the data source works correctly, the No Data Selected warning persists. This means that the data source provides no data for analysis, which is required to write our business rules.
Below is an example:
Basic data source with just one currency reference field EBAN-WAERS.
When you run the Ad-Hoc Query you receive data.
Basic data source with second currency reference field EKKO-WAERS.
When you run the Ad-Hoc Query no data is found.
Please also make reference to the following thread logged by my colleague (ERROR: Select Currency/UoM field for the selected analyzed fields)
Any assistance to receive data with duplicate fields from separate tables will be highly appreciated.
Thanking you in advance.
Regards
Gary KhanHi
following are the error messages from dump
hrtText
There is already a line with the same key.
hat happened?
Error in ABAP application program.
The current ABAP program "SAPLCKMS" had to be terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
rror analysis
You wanted to add an entry to table "\FUNCTION-POOL=CKMS\DATA=T_DYN_CKMLCR",
which you declared
with a UNIQUE KEY. However, there was already an entry with the
same key.
This may have been in an INSERT or MOVE statement, or within a
SELECT ... INTO statement.
In particular, you cannot insert more than one initial line into a
table with a unique key using the INSERT INITIAL LINE... statement.
rigger Location of Runtime Error
Program SAPLCKMS
Include LCKMSF01
Row 226
Module type (FORM)
Module Name DYNAMIC_PERIOD_CLOSING
Source code where dump ocured
222
223 APPEND ht_ckmlpp TO t_add_ckmlpp.
224 APPEND LINES OF ht_ckmlcr TO t_add_ckmlcr.
225 INSERT ht_ckmlpp INTO TABLE t_dyn_ckmlpp.
>>>> INSERT LINES OF ht_ckmlcr INTO TABLE t_dyn_ckmlcr.
227 ENDWHILE.
Also I guess there is problem with material ledger in R/3 side
I have never worked on material ledger before so dont hav idea of Tcode and tables in SAP R/3 for material ledger.
Thanks
Navneet
Maybe you are looking for
-
How to alter table in sql server2008
Hi Friends, I have import one table and want to alter table. How do i do this
-
My spry horizontal menu bar is now displaying vertical. How do I fix it?
My horizontal spry menu bar displays correctly at http://www.matthewvandyke.com/ar/photos/ but displays vertical at http://www.matthewvandyke.com/ar/about.html. It started doing this a few days ago and I am not sure why. Can anyone take a look at th
-
How to Create Hierarchy From Flat file Structure
Hi Gurus, There is a scenario for me regarding the Hierarchy. Required Hierarchy structure - Region>Director>Manager-->Sales id I have flat file which gives the info like user id , sales id , manager id, director id. But the transaction data Flat fil
-
Hi, I would like to know how to get the current time (07H25 for instance). Does someone know how to do it ? Thanks in advance, Fred.
-
Hi all, We would like to bring cisco prime assurance 9.1 in to our Organization Guys could you please provide me install guide or screen shot of the application for the assurance version 9.1 and I wanted to know the prerequisite for this applicatio