How to get field name dynamically of a table
Hi,
I have a table which has 5 fields, now i want to know the name of the fields dynamically at run time
not the values each fields hold.
I have tried field symbols, get reference but all i got the value of the field not the field name.
is there any way i can get the field name.
regards,
mayank
1. If it is a DDIC table, you can use the FM 'DDIF_FIELDINFO_GET'. Search in SDN for details.
2. If it is an internal table, check this code:
TYPE-POOLS: abap.
PARAMETERS p_table TYPE tabname .
DATA: lcl_table TYPE REF TO cl_abap_tabledescr,
lcl_struc TYPE REF TO cl_abap_structdescr,
it_fields TYPE abap_compdescr_tab,
wa_fields TYPE abap_compdescr.
DATA: dref TYPE REF TO data.
FIELD-SYMBOLS: <itab> TYPE ANY.
CREATE DATA dref TYPE STANDARD TABLE OF (p_table).
ASSIGN dref->* TO <itab>.
START-OF-SELECTION.
* Get the Table details
lcl_table ?= cl_abap_typedescr=>describe_by_data( <itab> ).
* Get the table line type i.e., structure details
lcl_struc ?= lcl_table->get_table_line_type( ).
* Get the components(fields) of the table line
it_fields = lcl_struc->components.
LOOP AT it_fields INTO wa_fields.
WRITE: / wa_fields-name.
ENDLOOP.
BR,
Suhas
Similar Messages
-
Getting field names of an internal table
Hi all,
Does anyone know if exists a statement, function module or method that gets the field names of an internal table ?
Thanks in advance,
DavidHi,
See this
REPORT typedescr_test.
TYPES:
BEGIN OF my_struct,
comp_a type i,
comp_b type f,
END OF my_struct.
DATA:
my_data TYPE my_struct,
descr_ref TYPE ref to cl_abap_structdescr.
FIELD-SYMBOLS:
<comp_wa> TYPE abap_compdescr.
START-OF-SELECTION.
descr_ref ?= cl_abap_typedescr=>describe_by_data( my_data ).
WRITE: / 'Typename :', descr_ref->absolute_name.
WRITE: / 'Kind :', descr_ref->type_kind.
WRITE: / 'Length :', descr_ref->length.
WRITE: / 'Decimals :', descr_ref->decimals.
WRITE: / 'Struct Kind :', descr_ref->struct_kind.
WRITE: / 'Components'.
WRITE: / 'Name Kind Length Decimals'.
LOOP AT descr_ref->components ASSIGNING <comp_wa>.
WRITE: / <comp_wa>-name, <comp_wa>-type_kind,
<comp_wa>-length, <comp_wa>-decimals.
ENDLOOP. -
How to get agent name dynamically
Hi All,
Is there any ODI method to get the agent name using which the current jobs are executing.
Thanks,Hi,
Yes, <%=odiRef.getSession("AGENT_NAME")%> Substitution API will retrieve the PHYSICAL agent which is running the current job.
Please explore oracledi_api_reference.pdf for more info.
Thanks,
Guru -
How to get field name on Production Order
Dear All,
I am going to make report on using items from production order. I'm facing problem to get following fields. These fields are on production ordersu2019 screen and tab is Summary.
1-Actual Component Cost
2-Actual Additional Cost
3-Actual Product Cost
I don't know where these fields are in database.
Can anybody help me in this regards
Sohail Anwar AliDear Sohail Anwar Ali,
By B1 help:
Actual Component Cost Total value of all components issued to the Production Order.
Actual Additional Cost Displays the actual additional costs that occur when a component is defined in the Item Master Data as a non-inventory item, for example, a service or labor cost.
If there is more than one additional cost for the item, the cost displayed here is the sum of all additional costs.
The field is updated on product completion.
Actual Product Cost Total value of all products received for this Production Order.
Best Regards
Jane Jing
SAP Business One Forums team -
How to get the class name and field name dynamically
Hi
I have a class (ex: Contract) the fields (ex : a,b,c) .i need to get the class name and field name dynamically
ex
if( validation file for the field Contract.a){
return contract.a;
}else if(validation file for the field Contract.b){
return contract.b;
how to pass the field name and object dynamically
Please help me .............
Thanks in Advance..
Edited by: 849614 on Aug 11, 2011 6:49 AMYoungWinston wrote:
maheshguruswamy wrote:
Agreed, but IMO, i still feel its best if there is no tie in between consumer class level details and the database it talks to. A service layer is needed in between them.Sounds like you've done a bit of this before. Me, I've either been a modeller/DBA, doling out data, or a nuts and bolts programmer (and actually more toolmaker than apps, but did a bit of that too).
Do you know of a good book about the "middle ground" (ie, these service layers)? I understand it empirically, but haven't had a lot of exposure to it.
Winston
Edited by: YoungWinston on Aug 11, 2011 10:34 PM
PS: Apologies. Edited my previous post, presumably while you were composing your reply, when I finally realized what '.filed' meant.Most of my work is in web development, never been a DBA :) . The biggest 'concern' in my shop is 'separation of concerns'. The UI group reports up to a different IT head, the DB group reports up to a different IT head and so on. The looser the coupling between these systems, the lesser the project costs (Integration, QA etc) are. Martin Fowler's books contain good information about separation of concerns in an enterprise environment. The two books which i recommend are
[url http://www.amazon.com/Patterns-Enterprise-Application-Architecture-Martin/dp/0321127420]Enterprise Application Architecture and
[url http://www.amazon.com/Enterprise-Integration-Patterns-Designing-Deploying/dp/0321200683/ref=pd_sim_b_1]Enterprise Integration Patterns -
How to get the field name of an internal table during runtime?
How to get the field name of an internal table during runtime?
Hi Sudhir,
Declare and Use Get Cursor Field in Your Prm to get the field Name of the Intenal Table
Example Code:
<b> DATA: v_field(60). " Insert this code.
GET CURSOR FIELD v_field. " Insert this code.</b>
<b>CHECK v_field = 'ITAB-KUNNR'. " Insert this code. (or)
Write: v_field.</b>
Regards,
Ramganesan K. -
How to get the name of a Data Element of a generic Table!
Hi guys!
In my function i have the following import paramenter
i_outtab type standard table
now i import a table and i want to get the dataelement of the fields.
is there a way to do this??Hello Thomas
Perhaps the following sample report may be useful for you.
*& Report ZUS_SDN_RTTI_STRUCT_COMPONENTS
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1145711"></a>
*& Thread: How to get the name of a Data Element of a generic Table!
REPORT zus_sdn_rtti_struct_components.
TYPE-POOLS: abap.
TYPES: BEGIN OF ty_s_outtab.
TYPES: bukrs TYPE bukrs.
TYPES: kunnr TYPE kunnr.
TYPES: END OF ty_s_outtab.
DATA: gdo_data TYPE REF TO data.
DATA: gs_outtab TYPE ty_s_outtab.
DATA: go_typedescr TYPE REF TO cl_abap_typedescr,
go_structdescr TYPE REF TO cl_abap_structdescr,
go_datadescr type ref to cl_abap_datadescr.
DATA: gs_comp TYPE abap_compdescr,
gd_dtel type string,
gt_dfies type ddfields.
FIELD-SYMBOLS:
<gs_struct> TYPE ANY.
START-OF-SELECTION.
BREAK-POINT.
GET REFERENCE OF gs_outtab INTO gdo_data.
ASSIGN gdo_data->* TO <gs_struct>.
go_typedescr = cl_abap_typedescr=>describe_by_data( <gs_struct> ).
go_structdescr ?= go_typedescr.
BREAK-POINT.
LOOP AT go_structdescr->components INTO gs_comp.
go_datadescr = GO_STRUCTDESCR->GET_COMPONENT_TYPE( gs_comp-name ).
gd_dtel = go_datadescr->get_relative_name( ).
write: / syst-tabix, 'Data element =', gd_dtel.
ENDLOOP.
END-OF-SELECTION.
Regards
Uwe -
How to get Variable name in output (Report Writer/Painter)
Hello Experts,
We have maintained one Repot by using Report Writer, this is the report for Cost center (periodic report), input fields are Fiscal year, Period and Cost Center. In out put system will display the selected cost center balances for individual cost element.
Output: Excel format: in first sheet it will display balance of the total cost centers selected and from second sheet it will display individual cost center balances.
My requirement is in the output system is displaying sheet name as CC1,CC2,CC3.......CC50, but my user want to display this as Cost Center 1, Cost Center 2, Cost Center 3...... like this. we have maintained variable name as Cost center 1, cost center 2....., but why system is displaying as CC1,CC2,.... .
Please help me how to get the full description as sheet name in excel.
Thanks ......SudheerHello Everybody,
Please help me how to get variable name in Report Painter outout ( Excel format ).
Thanks -
How to get list name through javascript?
Hi,
I wrote javascript for getting list items but here I'm hard coded list name as "Projects"(my list name). How can I get list name automatically with out hard coding,
Appreciate if anyone help.
Thank you.
function DoLogicalDelete()
var clientContext = null;
var oList = null;
var oListItem = null;
// var lstItmIsDeleted = null;
var itmID = getQuerystring('ID');
clientContext = SP.ClientContext.get_current();
oList = clientContext.get_web().get_lists().getByTitle('Projects');
// var oListItemID = SP.ListOperation.Selection.getSelectedItems(clientContext);
oListItem = oList.getItemById(itmID); // getting ID
clientContext.load(oListItem,"Title", "IsDeleted"); // load items to oListItem
oListItem.set_item('IsDeleted', true);
oListItem.update();
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded),Function.createDelegate(this, this.onQueryFailed));Not sure on which context you are executing the code. If you executing this from the list form and trying to get the current list, then you may need to get the list name from the breadcrumb/list title field. Refer to the following posts for more information
http://sharepoint.stackexchange.com/questions/39008/how-to-get-list-name-from-js-object-model-list-name-from-url-problem
http://itrob.be/sharepoint-get-all-lists-names-in-javascript-spservice-and-jquery/
--Cheers -
How to get column names for a specific view in the scheme?
how to get column names for a specific view in the scheme?
TIA
Don't have DD on the wall anymore....or this?
SQL> select text from ALL_VIEWS
2 where VIEW_NAME
3 ='EMP_VIEW';
TEXT
SELECT empno,ename FROM EMP
WHERE empno=10 -
How to get field separator in flat file using GUI_DOWNLOAD function
hi,
how to get field separator in flat file using GUI_DOWNLOAD function.
thanking you.Hi,
Use WRITE_FIELD_SEPARATOR = 'X'.
Check this sample code
REPORT z_file_download.
DATA: w_name(90) TYPE c.
DATA:
BEGIN OF fs_flight,
carrid LIKE sflight-carrid,
connid LIKE sflight-connid,
fldate LIKE sflight-fldate,
price LIKE sflight-price,
currency LIKE sflight-currency,
END OF fs_flight.
DATA:
BEGIN OF fs_head,
carrid(10) TYPE c,
connid(10) TYPE c,
fldate(10) TYPE c,
price(10) TYPE c,
curr(10) TYPE c,
END OF fs_head.
DATA:
t_head LIKE
TABLE OF
fs_head.
DATA:
t_flight LIKE
TABLE OF
fs_flight.
fs_head-carrid = 'CARRID'.
fs_head-connid = 'CONNID'.
fs_head-fldate = 'FLDATE'.
fs_head-price = 'PRICE'.
fs_head-curr = 'CURRENCY'.
APPEND fs_head TO t_head.
SELECT-OPTIONS:
s_carrid FOR fs_flight-carrid.
START-OF-SELECTION.
SELECT carrid
connid
fldate
price
currency
FROM sflight
INTO TABLE t_flight
WHERE carrid IN s_carrid.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
filename = 'D:\flight.xls'
FILETYPE = 'ASC'
* APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* CONFIRM_OVERWRITE = ' '
* NO_AUTH_CHECK = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = ' '
* IMPORTING
* FILELENGTH =
tables
data_tab = t_head
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'D:\flight.xls'
filetype = 'ASC'
append = 'X'
write_field_separator = 'X'
TABLES
data_tab = t_flight
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc EQ 0.
MESSAGE 'Download successful' TYPE 'I'.
ENDIF.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
Error in reciever file adapter , where i am getting file name dynamically
hi all,
error in reciever file adapter , where i am getting file name dynamically, please help me in this isssue , i am trying for a long time
MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'ns0:MT_eINVOICE_RECV' found in document', probably configuration error in file adapter (XML parser error)': java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'ns0:MT_eINVOICE_RECV' found in document', probably configuration error in file adapter (XML parser error)'i am getting new error
MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Channel has not been correctly initialized and cannot process messages
this is my strcuture
and i have changed my structure
<HEADER>
<ADDRESS1/>
<ADDRESS2/>
<ADDRESS3/>
<ADDRESS4/>
</HEADER>
<HEADER_GST>
<TAX1/>
<TAX2/>
<TAX3/>
</HEADER_GST>
<LINE>
<QTY/>
<UOM/>
<UNIT_AMT/>
<CHARGE_TO_DT/>
</LINE>
<FILENAME>
<FILENAME/>
</FILENAME>
i have given the recordset structure as
HEADER,HEADER_GST,LINE,FILE -
How to get the name of the current tab.
Hi Experts,
I have two tabs in my tab strip and a button common to both the tabs.Can you please let me know how to get the name of the current tab in the event method of the push button.
Thanks in advance.
Regards,
Arun1.Declare an Action for OnSelect event of Tabstrip. This event is triggered whenever any change in tab occurs.
2. Declare an Import Parameter in this method
Tab type String.
3. This parameter has value of the selected TAB.
4. You can set this value in some Attribute in Attribute Tab in this event only (OnSelect):
wd_this->Att = Tab.
Att is the attribute created by you in Attributes Tab of View. ( of type String)
5. Now the selected Tab ID is stored in this Attribute Att.
6. In the Onaction of Button , retrieve the selected tab value from this attribute using :
Data : lv type string.
lv = wd_this->Att
Now lv has your selected TAB ID.
I hope it would help you.
Edited by: Saurav Mago on Oct 13, 2009 2:22 PM -
Hi all,
Please tell me how to get field from following path
GO to MSC2N --
insert material, batch , plant , storage location
Now select classification...
there is box containing 'characsteristics descr ' & value
so how to get that value
I think that values are store in table cawn but i wont found any link to get that
Correct ans will be rewardedHi,
If you are trying to get the vaues of these charecteristics in your report, then
Try using the fm VB_BATCH_GET_DETAIL
CALL FUNCTION 'VB_BATCH_GET_DETAIL'
EXPORTING
matnr = is_final-matnr
charg = is_final-charg
werks = is_final-werks
get_classification = 'X'
* EXISTENCE_CHECK =
* READ_FROM_BUFFER =
* NO_CLASS_INIT = ' '
* LOCK_BATCH = ' '
IMPORTING
ymcha = ymcha
* CLASSNAME =
TABLES
char_of_batch = it_batch
EXCEPTIONS
no_material = 1
no_batch = 2
no_plant = 3
material_not_found = 4
plant_not_found = 5
no_authority = 6
batch_not_exist = 7
lock_on_batch = 8
OTHERS = 9
also the function module VC_I_GET_CONFIGURATION
And for table try cabn
Regards
Debarshi -
Can I get field name of Selection screen ?
Hi, experts.
I'd like to manage PGM's screens & fields of screens. I need to know field names of selection screen in external PGMs to manage input values of those fields.
For values, I'll use 'Dynp_values_read', but what should I use for getting field names of selection screen?
Is there any functions, classes or tables for PGM's fields of selection screen?
I've found tables&functions for this and I found D020S, D020T, D021T for PGM's screen. But I counld't see proper field names that shows on a selection screen when I excuted PGM. I guess there's a conversion routine between data that saved in repository and field name on screen.
Please let me know what should I use a function, tables or else.
Thanks.Hi
Use Read text pool syntax
READ TEXTPOOL program name
INTO T_TPOOL
LANGUAGE 'NL'.
within TB_TPOOL all select option field namees will be stored under field ID with type S
Edited by: Lavanya K on Apr 22, 2009 10:02 AM
Maybe you are looking for
-
My phone wont restore because of 3194 error when to upgrading to IOS5
my phone has beeen messed up since yesterday and for some reason my number has been changed to 0000002261 wich is not my number at all!!! idk what to do i can get itunes to download the IOS5 but when the error always pops up i have went into my host
-
Duty/Tax Requirements in different sales scenarios.
Hi, Could anyone please tell me what are the statutaory requirements in terms of excise duty, LST, CST, VAT for sales/stock transfers between- 1- A factory and a factory in the same state in India 2- A factory and a factory in another state in India
-
Laserwriter Pro 630, Mountain Lion, and Macbook Pro
Hi, I have a very old Laserwriter Pro 630 that I use for simple inexpensive proofing. On my old system (G4 Tower w/Leopard), it was connected via an ethernet hub. I'm now the proud owner of a Macbook Pro Retina (with no ethernet port), and I can't fi
-
Flexconnect AP not joining Controller
Hi Community , I have some flexconnect APs in remote side . But they are not able to join controller 5508 (7.6) and flexconnect is also showing down in PI. Any reason ??
-
Updating to IOS 5 won't update and now won't restore my backup.
After creating a backup of my ipod touch and then updating it. It failed the update then saids it needs to restore and saids it cannot restore. Now I cannot update or restore. Anyone have ideas?