Some help needed on dynamic internal tables and field symbols
Hi,
I have a dyn internal table <dyn_table_r>.
One of its fields is kna1-kunnr.
I have another wa <fs>, with only one field alt_kunnr.
now i want to modify the data of <dyn_table_r>-kna1-kunnr from <fs>-alt_kunnr
How should i do it?
Regards ,
Harshit Rungta
Harshit Rungta:
You have opened a number of related questions today. I'd like to see the other ones closed before you continue with this one.
I'll lock this but will re-open it once the others are marked as solved.
Rob
Similar Messages
-
Creating dynamic internal table(Not field symbol table)
Hi Experts,
I am facing problem creating Intarnal table
I have fieldcatalog, I want create dynamic internal table(Not field symbol table).
I have written----
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
i_style_table =
it_fieldcatalog = it_fldcat
it_fieldcatalog = me->gt_fieldcat
i_length_in_byte =
IMPORTING
ep_table = lt_new_table
e_style_fname =
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
ASSIGN lt_new_table->* TO <gt_dyn_repdata>.
CREATE DATA ls_new_line LIKE LINE OF <gt_dyn_repdata>.
ASSIGN ls_new_line->* TO <gs_dyn_repdata>.
above logic creating dynamic field symbol table.... But I want create normal internal table.
Thanks,
RajasekharHi
What do you mean?
It needs to use the field-symbol, this is the price to pay if it wants a dynamic object
Max -
Help needed XML to Internal table and vice versa
Hello frnds, I need to convert Internal table to XML and Vice versa.
Now I am able to most of the part except for this...
the xml which I have to generate looks something like this...
- <trade_dt>
- <![CDATA[ 20111108000000:20111108235959
]]>
</trade_dt>
its a range I think
And then the reponse which I get back the XML is like
- <lockinfo>
- <![CDATA[
TRD_HEADER 1045 1 2
ACT_CASHFLOW 1042 1
TRD_TERM 1045 2
]]>
</lockinfo>
Is there any provision in class cl_ixml or class if_ixml_element to handle this part.....
Edited by: Amit Sawant on Dec 28, 2011 3:51 PMHello Amit,
I would suggest you, to use the XSL-Transformations, which can be inbound used in ABAP.
For example:
DATA:
l_xml TYPE string,
lt_flights TYPE TABLE OF SFLIGHT.
SELECT * FROM SFLIGHT INTO TABLE LT_FLIGHT.
CALL TRANSFORMATION id
SOURCE DATA = lt_flights
RESULT XML l_xml.
Now, you have a XML-String which is in the ABAP-XML Notation, which means, that ABAP can move this XML-Data back into an internal table/structure.
For the backward, you have to use the following statement:
CALL TRANSFORMATION id
SOURCE XML l_xml
RESULT DATA = lt_flights.
As you will see, it is very easy. The Transformation "id" is just one example and build in. When you have to transform the data, or do not want to have the ASX-Notation in it, you should at least define your own transformations with the transaction XSLT_TOOL and use it similar to the transformation "id".
Kind Regards,
Hendrik -
Dynamic internal tables using field symbols
Hello,
Is it possible to create a dynamic table where the no of fields in the internal table can be created dynamically(using field symbols).
Say sometimes internal tables with 10 fields and depending upon the requirement the fields can be dynamically increased or decreased in runtime.
Thanks.Hi,
Go through the following code....
*Data definitions
*** Tables
data: lt_data type ref to data.
data: lt_fieldcatalog type lvc_t_fcat.
*** Structure
data: ls_fieldcatalog type lvc_s_fcat.
*** Data References
data: new_line type ref to data,
fs_data type ref to data.
*** Field Symbols
field-symbols: <fs_data> type ref to data,
<fs_1> type any table,
<fs_2>,
<fs_3>.
*Populating the internal table with fieldnames required for our dynamic
*internal table
ls_fieldcatalog-fieldname = 'MANDT'.
append ls_fieldcatalog to lt_fieldcatalog.
ls_fieldcatalog-fieldname = 'CARRID'. "Fieldname
ls_fieldcatalog-inttype = 'C'. "Internal Type C-> Character
append ls_fieldcatalog to lt_fieldcatalog.
ls_fieldcatalog-fieldname = 'CONNID'.
ls_fieldcatalog-inttype = 'N'.
append ls_fieldcatalog to lt_fieldcatalog.
ls_fieldcatalog-fieldname = 'FLDATE'.
ls_fieldcatalog-inttype = 'D'.
append ls_fieldcatalog to lt_fieldcatalog.
ls_fieldcatalog-fieldname = 'PRICE'.
ls_fieldcatalog-inttype = 'P'.
append ls_fieldcatalog to lt_fieldcatalog.
ls_fieldcatalog-fieldname = 'CURRENCY'.
ls_fieldcatalog-inttype = 'C'.
append ls_fieldcatalog to lt_fieldcatalog.
*Calling the method CREATE_DYNAMIC_TABLE
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = lt_fieldcatalog
importing
ep_table = fs_data
exceptions
generate_subpool_dir_full = 1
others = 2
if sy-subrc <> 0.
endif.
*Assigning Field-Symbol to our dynamic internal table
assign lt_data to <fs_data>.
*Internal Table is ready, now to put data in that table
*** So <FS_1> now points to our dynamic internal table.
assign fs_data->* to <fs_1>.
*** Next step is to create a work area for our dynamic internal table.
create data new_line like line of <fs_1>.
*** A field-symbol to access that work area
assign new_line->* to <fs_2>.
*** And to put the data in the internal table
select
mandt
carrid
connid
fldate
price
currency
from sflight
into corresponding fields of table <fs_1>.
*** Access contents of internal table
loop at <fs_1> assigning <fs_2>.
do 5 times.
assign component sy-index of structure <fs_2> to <fs_3>.
write: <fs_3>.
enddo.
skip 1.
endloop.
top-of-page.
write:/5 'FUJITSU CONSULTING COMPANY' inverse color 6,
50 sy-datum inverse color 6,
70 sy-pagno inverse color 6.
uline.
<REMOVED BY MODERATOR>
Vijay C
Code Formatted by: Alvaro Tejada Galindo on Apr 14, 2008 1:47 PM -
Dynamic Internal table with field symbol
I made the report where the user enters two different tables and two fields that are to be compared.
Eg. If I enter (MARA & NAME1) and (MARC & NAME2) , I wish to compare all the entries of Mara-name1 against all entries in Marc-name2.
<u>The code I need to write is:</u>
DATA:
gdo_data TYPE REF TO data.
DATA:
gdo_data1 TYPE REF TO data.
FIELD-SYMBOLS:
<gt_itab> TYPE table,
<wa> LIKE <gt_itab>, "<gt_itab>,
<gs_entry> TYPE ANY.
FIELD-SYMBOLS:
<gt_itab1> TYPE table,
<wa1> LIKE <gt_itab>, "<gt_itab>,
<gs_entry1> TYPE ANY.
PARAMETERS:
p_table TYPE tabname, " DEFAULT 'KNA1',
p_fld TYPE fieldname. " DEFAULT 'KUNNR'.
PARAMETERS:
p_table1 TYPE tabname, " DEFAULT 'KNA1',
p_fld1 TYPE fieldname.
DATA: var TYPE fieldname.
var = p_fld.
DATA: var1 TYPE fieldname.
var1 = p_fld1.
START-OF-SELECTION.
CREATE DATA gdo_data TYPE TABLE OF (p_table).
ASSIGN gdo_data->* TO <gt_itab>.
CREATE DATA gdo_data1 TYPE TABLE OF (p_table1).
ASSIGN gdo_data1->* TO <gt_itab1>.
SELECT * FROM (p_table) INTO CORRESPONDING FIELDS OF TABLE <gt_itab>.
SELECT * FROM (p_table1) INTO CORRESPONDING FIELDS OF TABLE <gt_itab1>.
<b> LOOP AT <gt_itab> ASSIGNING <gs_entry>.
READ TABLE <gt_itab1> ASSIGNING <gs_entry1>
WITH KEY (var1) = <gt_itab>-(var).
IF sy-subrc EQ 0.
MESSAGE 'Success' TYPE 'S'.
ENDIF.
ENDLOOP.</b>
END-OF-SELECTION.
But the portion in bold is creating error: <b><gt_itab> is a table without a header lineand therefore has no component called "".</b>
please help.Hi Amit
Try like this
LOOP AT <gt_itab> ASSIGNING <gs_entry>.
READ TABLE <gt_itab1> ASSIGNING <gs_entry1>
WITH KEY (var1) = <b><gs_entry></b>-(var).
IF sy-subrc EQ 0.
MESSAGE 'Success' TYPE 'S'.
ENDIF.
ENDLOOP.
Regards,
Atish -
Delete row from internal table using field symbol.
Hi friends,
I created dynamic internal table using field symbol. I want to delete some data using where clause.
for example. i want to use like,
DELETE <FS> WHERE KUNNR = WA_KNA1-KUNNR.
Like the above statment it won't work. How i can use delete with where clause in field symbols.
Hope any one can help me.
Thanks and regards
Srikanth. Shi Srikanth,
I think you have to LOOP through the whole internal table and check each line and decide to delete or not:
LOOP at <itab> INTO <wa>.
ASSIGN COMPONENT 'KUNNR' OF STRUCTURE <wa> TO <field>.
CHECK <field> IS ASSIGNED.
IF <field> EQ WA_KNA1-KUNNR.
DELETE ...
ENDIF.
UNASSIGN <field>.
ENDLOOP.
hope this helps
ec -
Dynamic Work Area and field symbol
Hi All,
I'm have a big internal table like this
data: begin of data occurs 0,
Field01,
Field02,
Field03,
*bucket 1
Field04,
Field05,
Field06,
*bucket 2
Field04,
Field05,
Field06,
*bucket 3
Field04,
Field05,
Field06,
Field 1, 2 3 will be the same for pernr, first last name.
Field 4, 5, 6 are the same format but different numbers (or values ) in different buckets.
Each bucket can be shown (or not) based on the condition of a person, for example if that person live in 2 states, it will show 2 bucket with 2 address info inside each.
I will run this under get pernr to sort out each person who have many address or not.
Can I use dynamic work area and field symbol here? if I can, how?
Really appreciate your help with points...You can use the ASSIGN COMPONENT ... and than APPEND the work area to the table.
Check out this sample program:
REPORT ZTEST_NP.
DATA: BEGIN OF ITAB OCCURS 0,
F1 TYPE I,
F2 TYPE I,
F3 TYPE I,
END OF ITAB.
DATA: WA_ITAB LIKE ITAB.
DATA: L_CNT TYPE I.
FIELD-SYMBOLS: <F_FLD> TYPE ANY.
DO 10 TIMES. " I want 10 reocrds
CLEAR L_CNT.
DO 3 TIMES. " I have 3 fields
L_CNT = L_CNT + 1.
ASSIGN COMPONENT L_CNT OF STRUCTURE WA_ITAB TO <F_FLD>.
<F_FLD> = L_CNT.
ENDDO.
APPEND WA_ITAB TO ITAB.
CLEAR ITAB.
ENDDO.
LOOP AT ITAB INTO WA_ITAB.
WRITE: / WA_ITAB-F1,
WA_ITAB-F2,
WA_ITAB-F3.
ENDLOOP.
Regards,
Naimesh Patel -
Internal table to field symbol
hi all,
type-pools : abap.
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
data: dy_table type ref to data,
dy_line type ref to data,
xfc type lvc_s_fcat,
ifc type lvc_t_fcat.
*data : dyn_itab2 type ANY table.
selection-screen begin of block b1 with frame.
parameters: p_table(30) type c.
selection-screen end of block b1.
start-of-selection.
BREAK-POINT.
perform get_structure.
perform create_dynamic_itab.
perform get_data.
PERFORM OUTPUT.
*perform write_out.
form get_structure.
data : idetails type abap_compdescr_tab,
xdetails type abap_compdescr.
data : ref_table_des type ref to cl_abap_structdescr.
Get the structure of the table.
ref_table_des ?=
cl_abap_typedescr=>describe_by_name( p_table ).
idetails = ref_table_des->components.
*idetails] = ref_table_des->components[.
loop at idetails into xdetails.
clear xfc.
xfc-fieldname = xdetails-name .
xfc-datatype = xdetails-type_kind.
xfc-inttype = xdetails-type_kind.
xfc-intlen = xdetails-length.
xfc-decimals = xdetails-decimals.
append xfc to ifc.
endloop.
endform.
form create_dynamic_itab.
Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = ifc
importing
ep_table = dy_table.
here i want to assighn the structure of dy_table to internal atble.
assign dy_table->* to <dyn_table>.
Create dynamic work area and assign to FS
create data dy_line like line of <dyn_table>.
assign dy_line->* to <dyn_wa>.
endform.
form get_data.
Select Data from table.
select * into table <dyN_table> UP TO 10 ROWS
from (p_table).
endform.
Write out data from table.
FORM OUTPUT.
loop at <dyn_table> into <dyn_wa>.
do.
assign component sy-index
of structure <dyn_wa> to <dyn_field>.
if sy-subrc = 0.
exit.
endif.
if sy-index = 1.
write:/ <dyn_field>.
else.
write: <dyn_field>.
endif.
enddo.
endloop.
ENDFORM.
how can i achieve this one.
regards
sivaHi,
Check this Code ...
LOOP AT <dyn_table> INTO <dyn_wa>.
DO.
ASSIGN COMPONENT sy-index
OF STRUCTURE <dyn_wa> TO <fs_field> .
IF sy-subrc NE 0.
EXIT.
ENDIF.
IF sy-index = 1.
WRITE:/ <fs_field>.
ELSE.
WRITE: <fs_field>.
ENDIF.
ENDDO.
ENDLOOP.
For reference check below code
DATA: it_fieldcat TYPE lvc_t_fcat . " Field catalog
DATA: wa_fieldcat LIKE LINE OF it_fieldcat. " Field catalog
DATA: it_dyn_table TYPE REF TO data, " Dynamic table
it_wa_dyn_table TYPE REF TO data. " Dynamic table
* Field sysmbols Begin with <fs> *
FIELD-SYMBOLS: <fs_dyn_table> TYPE STANDARD TABLE, " Dynamic tbale
<fs_dyn_table_temp> TYPE ANY , " Dynamic tbale
<fs_field> TYPE ANY , " Temp field for data assignment
<fs_field_temp> TYPE ANY . " Temp field for data assignment
* Macro *
* Macro Defination
* Building field catalog using macro defination
DEFINE m_fieldcat.
wa_fieldcat-fieldname = &1.
wa_fieldcat-scrtext_l = &2.
wa_fieldcat-coltext = &2.
wa_fieldcat-no_zero = &3.
wa_fieldcat-hotspot = &4.
wa_fieldcat-outputlen = &5.
wa_fieldcat-emphasize = &6.
* Appending workarea to internal table
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
END-OF-DEFINITION.
*& Form f005_prepare_field_catalog
* text
form f005_prepare_field_catalog .
REFRESH: it_fieldcat.
* Build the field catalog
m_fieldcat text-007 text-008 c_blank c_blank c_30 c_blank.
m_fieldcat text-009 text-010 c_blank c_blank c_30 c_blank.
SORT it_final_temp BY equnr point.
SORT it_final BY equnr point psort idate.
w_date1 = so_date-low.
* Loop to generate grid column at run time
* Loop - Till the lower date not equal to higer date
WHILE so_date-high GE w_date1.
* Changing date into actual date format using edit mask
WRITE w_date1 TO w_var4 USING EDIT MASK '__-__-____'.
m_fieldcat w_var4 w_var4 c_flag c_blank c_12 c_blank.
w_date1 = w_date1 + c_count.
CLEAR w_var4.
ENDWHILE.
*& Form f007_create_dynamic_table
* text: Create dynamic table
form f007_create_dynamic_table .
* Call method to create dynamic internal table
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fieldcat
IMPORTING
ep_table = it_dyn_table
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
SORT it_final_temp BY equnr point.
SORT it_final BY equnr point psort idate.
ASSIGN it_dyn_table->* TO <fs_dyn_table>.
CREATE DATA it_wa_dyn_table LIKE LINE OF <fs_dyn_table>.
ASSIGN it_wa_dyn_table->* TO <fs_dyn_table_temp>.
IF it_final_temp IS NOT INITIAL.
LOOP AT it_final_temp INTO wa_final_temp.
* Assign equipment number and it's field data to field symbols (Dynamic table)
* Assign field name to field symbol
ASSIGN text-007 TO <fs_field_temp>.
* Assign component name and it's value to dynamic table
ASSIGN COMPONENT <fs_field_temp> OF STRUCTURE <fs_dyn_table_temp> TO <fs_field>.
* Assign equipment number value to field symbol
<fs_field> = wa_final_temp-equnr.
* Assign Short Description and it's field data to field symbols (Dynamic table)
* Assign field name to field symbol
ASSIGN text-009 TO <fs_field_temp>.
* Assign component name and it's value to dynamic table
ASSIGN COMPONENT <fs_field_temp> OF STRUCTURE <fs_dyn_table_temp> TO <fs_field>.
* Assign short description value to field symbol
<fs_field> = wa_final_temp-psort.
* Loop to assign value of run time generated column.
IF it_final IS NOT INITIAL.
LOOP AT it_final INTO wa_final WHERE equnr = wa_final_temp-equnr
AND point = wa_final_temp-point.
w_date1 = wa_final-idate.
WRITE w_date1 TO w_var4 USING EDIT MASK '__-__-____'.
ASSIGN w_var4 TO <fs_field_temp>.
ASSIGN COMPONENT <fs_field_temp> OF STRUCTURE <fs_dyn_table_temp> TO <fs_field>.
<fs_field> = wa_final-cdiff.
CLEAR: wa_final, w_var4, w_date1.
ENDLOOP.
ENDIF.
CLEAR: wa_final_temp.
* Assign field symbol temporary table to final dynamic table
APPEND <fs_dyn_table_temp> TO <fs_dyn_table>.
CLEAR: <fs_dyn_table_temp>.
ENDLOOP.
ENDIF.
endform. " f007_create_dynamic_table -
Populating two dynamic internal tables and displaying the O/p as ALV
I want to develop a abap prototype program report for the SD document flow analysis...
There is a Fm : RV_ORDER_FLOW_INFORMATION in which if we pass the Sales order number it returns the flows as VBFA_TAB.
I need to populate two dynamic ITAB1 and ITAB2
the structure of ITAB1 should be like ColNm1....ColNmn
The values for ColNm1 will be Sales Order ColNm2 as Delivery or smthng else depending on field vbtyp_n.
ITAB 2 should have the corresponding values accly to ITAB1.
Then we need to display in ALV o/p.
The tables should be populated dynamically.
Can anybody throw some light on it and plz do write back with sample code to do the logic of it.Search in SDN with Dynamic internal tables.
you get lot of code samples and Discussions related to Dynamic internal tables.
you can also check with this class CL_ALV_TABLE_CREATE -
How 2 create dynamic internal table and can we pass it to gui_download FM
HI all,
How can we create a dynamic internal table?
I have a requirement where i have to create an internal table with the no. of fields depending on the selection screen values, i think tat can be possible though dynamic creation only.
How to solve this issue..?Pointers will be very much useful..
Thanks
Sunny.hi
Follow the code it will help you out....
REPORT YUSMM_TEXT2 .
*TABLES
TABLES: MARA, " General Material Data
MAKT, " Material Descriptions
T002. " Language Keys
* GLOBAL TYPE-POOL
TYPE-POOLS : SLIS.
* GLOBAL TYPES
TYPES: BEGIN OF TP_LANG ,
SPRAS LIKE T002-SPRAS,
LAISO LIKE T002-LAISO,
SRNO(3) TYPE N,
END OF TP_LANG.
TYPES: BEGIN OF TP_MATNR,
MATNR LIKE MARA-MATNR,
BEGRU LIKE MARA-BEGRU,
END OF TP_MATNR.
* DECLARATION FOR GLOBAL INTERNAL TABLES (WITH INCLUDE STRUCTURE)
DATA:GT_MAKT TYPE STANDARD TABLE OF MAKT, "Materialkurztexte,
GT_THEAD TYPE STANDARD TABLE OF THEAD, "SAPscript: Text-Header,
GT_LINETAB TYPE STANDARD TABLE OF TLINE, "SAPscript: Text-Zeilen,
GT_T002 TYPE STANDARD TABLE OF T002. "Language key
DATA: BEGIN OF GV_TEXT_OUTPUT_LINE,
MATNR LIKE MARA-MATNR,
BEGRU LIKE MARA-BEGRU,
MAKTX LIKE MAKT-MAKTX,
LTXT40(1250) TYPE C,
SRNO(3) TYPE N,
SPRAS LIKE T002-SPRAS,
END OF GV_TEXT_OUTPUT_LINE.
DATA: GT_MATNR TYPE STANDARD TABLE OF TP_MATNR,
WA_GT_MATNR TYPE TP_MATNR.
DATA: GT_LANG TYPE STANDARD TABLE OF TP_LANG,
WA_GT_LANG TYPE TP_LANG.
DATA: GT_TEXT_OUTPUT_LINE LIKE STANDARD TABLE OF GV_TEXT_OUTPUT_LINE,
GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
GV_FIELDCAT LIKE LINE OF GT_FIELDCAT,
CT_GT_FIELDCAT_IN LIKE GV_FIELDCAT,
GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
GV_REPID TYPE SY-REPID.
DATA: BEGIN OF GV,
FORMER_ERROR LIKE SY-MARKY, " Fehlermeldung bereits
FILE_OPEN(1), " Flag open file
REC_LENGTH TYPE I, " record length
MATNR TYPE MARA-MATNR, " material
REPID TYPE SYST-REPID,
RETCO TYPE SY-SUBRC,
END OF GV.
DATA: GV_MAKT TYPE MAKT,
GV_T002 TYPE T002,
GV_LANGU TYPE THEAD-TDSPRAS.
* DECLARATION FOR FIELD-SYMBOLS
FIELD-SYMBOLS: <FS_DATA> TYPE REF TO DATA,
<FS_DATA1> TYPE REF TO DATA,
<FS_2> TYPE STANDARD TABLE,
<FS_22> TYPE STANDARD TABLE,
<FS_1>,
<FS_11>,
<F>,
<FA>,
<LWA_LINE_WA>,
<LWA_LINE_WA1>.
DATA: IT_FLDCAT TYPE LVC_T_FCAT.
DATA: T_FLDCAT1 TYPE SLIS_T_FIELDCAT_ALV.
DATA: L_LT TYPE SLIS_LAYOUT_ALV.
DATA: WA_IT_FLDCAT TYPE LVC_S_FCAT.
DATA: WA_IT_FLDCAT1 TYPE SLIS_FIELDCAT_ALV.
DATA: GP_TABLE TYPE REF TO DATA.
DATA: WA_NEWLINE TYPE REF TO DATA.
*DECLARATION FOR CONSTANTS
CONSTANTS:
BEGIN OF GC,
TDID_GRUN TYPE THEAD-TDID VALUE 'GRUN',
TDOBJECT_MAT TYPE THEAD-TDOBJECT VALUE 'MATERIAL',
ON(01) TYPE C VALUE 'X',
YES(01) TYPE C VALUE 'X',
TXT(25) TYPE C VALUE 'MATERIAL DETAILS',
MAT(25) TYPE C VALUE 'MATERIAL NUMBER',
AUT(25) TYPE C VALUE 'AUTHORIZATION GROUP',
FOUND TYPE SY-SUBRC VALUE '00', " Return-Code
RC_OK TYPE SY-SUBRC VALUE '00', " Return-Code
OFF TYPE SY-SUBRC VALUE '00', " return code
FALSE TYPE SY-SUBRC VALUE '00', " boolean
TRUE TYPE SY-SUBRC VALUE '01', " boolean
END OF GC.
* DECLARATION FOR VARIABLES
DATA: V(3) TYPE N,
STR TYPE STRING,
STR1 TYPE STRING,
V_VAR(3) TYPE N,
V_VAR1(3) TYPE N,
V_FIELDNAME(15) TYPE C,
V_CHAR(15) TYPE C,
V_LINES(3) TYPE N,
MAKTEXT LIKE MAKT-MAKTX,
LT_DATA TYPE REF TO DATA,
LT_DATA1 TYPE REF TO DATA,
LWA_LINE TYPE REF TO DATA,
LWA_LINE1 TYPE REF TO DATA.
*SELECTION-SCREEN AND PARAMETERS
SELECTION-SCREEN: BEGIN OF BLOCK A1 WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS:
S_MATNR FOR MARA-MATNR, "MATERIAL NUMBER
S_MTART FOR MARA-MTART, "MATERIAL TEXT
S_LANG FOR MAKT-SPRAS. "LANGUAGE
PARAMETER: GP_SIZE TYPE I DEFAULT 200. "DATA LENGTH
SELECTION-SCREEN: END OF BLOCK A1.
* AT SELECTION SCREEN
AT SELECTION-SCREEN.
IF GP_SIZE < 0.
MESSAGE E002(00).
ENDIF.
IF GP_SIZE > 50000.
MESSAGE W130(26) WITH TEXT-004.
SET CURSOR FIELD 'gp_size'.
ENDIF.
* INITIALIZATION
INITIALIZATION.
GV-REPID = SY-REPID.
*START-OF-SELECTION
START-OF-SELECTION.
PERFORM GET_MARA_DATA
TABLES
GT_TEXT_OUTPUT_LINE
USING
S_MATNR[]
S_MTART[]
GP_SIZE
CHANGING
GV-RETCO
PERFORM GET_MAT_TEXT
TABLES
GT_MAKT
GT_TEXT_OUTPUT_LINE
GT_THEAD
GT_LINETAB
USING
GC
GV-RETCO
CHANGING
GV_TEXT_OUTPUT_LINE
GV_MAKT
PERFORM GET_LANG.
PERFORM DYNAMIC_TABLES.
PERFORM POPULATE_FINAL_TABLE.
PERFORM POPULATE_DYNAMIC_TABLE.
* END-OF-SELECTION
END-OF-SELECTION.
PERFORM DATA_OUTPUT.
*& Form get_mara_data
* Materialdaten lesen
* <->ct_gt_text_output_line Ausgabetabelle
* -->it_s_matnr Parameter Materialnummer
* -->it_s_mtart Parameter Materialart
* -->if_gp_size Parameter Anzahl Materialnummern
FORM GET_MARA_DATA TABLES CT_GT_TEXT_OUTPUT_LINE STRUCTURE
GV_TEXT_OUTPUT_LINE
USING IT_S_MATNR LIKE S_MATNR[]
IT_S_MTART LIKE S_MTART[]
IF_GP_SIZE
CHANGING IF_GV-RETCO. "#EC *
* MARA in die Übergabestruktur einlesen
SELECT MATNR BEGRU
FROM MARA UP TO IF_GP_SIZE ROWS
APPENDING CORRESPONDING FIELDS OF TABLE GT_MATNR
WHERE MATNR IN IT_S_MATNR
AND MTART IN IT_S_MTART.
IF_GV-RETCO = SY-SUBRC.
ENDFORM. " get_mara_data
*& Form get_mat_text
* Kurz- und Langtexte zum Material lesen
* <->ct_gt_makt Materialkurztexte
* <->ct_gt_text_output_line Ausgabetabelle
* <->ct_gt_thead Kopftabelle für ALV
* <->ct_gt_linetab Zeilentabelle für ALV
* -->if_gc Globale Konstanten
* <--cf_gv_text_output_line Struktur Ausgabetabelle
* <--cf_gv_makt Struktru Materialkurztexte
FORM GET_MAT_TEXT TABLES CT_GT_MAKT STRUCTURE MAKT
CT_GT_TEXT_OUTPUT_LINE STRUCTURE
GV_TEXT_OUTPUT_LINE
CT_GT_THEAD STRUCTURE THEAD
CT_GT_LINETAB STRUCTURE TLINE
USING
IF_GC LIKE GC
IF_GV-RETCO
CHANGING CF_GV_TEXT_OUTPUT_LINE LIKE
GV_TEXT_OUTPUT_LINE
CF_GV_MAKT LIKE GV_MAKT
DATA: STRG TYPE STRING,
STRG1(1255) TYPE C.
IF IF_GV-RETCO = IF_GC-FOUND.
* Materialkurztexte in alles Sprachen einlesen
SELECT * FROM MAKT APPENDING TABLE CT_GT_MAKT
FOR ALL ENTRIES IN GT_MATNR "ct_gt_text_output_line
WHERE MATNR = GT_MATNR-MATNR " ct_gt_text_output_line-matnr
* Kurztexte in die sprachabhängigen Felder bringen
LOOP AT GT_MATNR INTO WA_GT_MATNR.
LOOP AT CT_GT_MAKT INTO CF_GV_MAKT
WHERE MATNR = WA_GT_MATNR-MATNR.
CF_GV_TEXT_OUTPUT_LINE-MATNR = WA_GT_MATNR-MATNR.
CF_GV_TEXT_OUTPUT_LINE-BEGRU = WA_GT_MATNR-BEGRU.
CF_GV_TEXT_OUTPUT_LINE-MAKTX = CF_GV_MAKT-MAKTX.
CF_GV_TEXT_OUTPUT_LINE-SPRAS = CF_GV_MAKT-SPRAS.
* LANGTEXT
CLEAR CT_GT_THEAD[].
CT_GT_THEAD-TDOBJECT = IF_GC-TDOBJECT_MAT.
CT_GT_THEAD-TDNAME = WA_GT_MATNR-MATNR.
CT_GT_THEAD-TDID = IF_GC-TDID_GRUN.
CT_GT_THEAD-TDSPRAS = CF_GV_MAKT-SPRAS.
CALL FUNCTION 'TEXT_READ'
EXPORTING
I_HEADER = CT_GT_THEAD
I_READONLY = IF_GC-ON
IMPORTING
E_HEADER = CT_GT_THEAD
TABLES
T_LINES = CT_GT_LINETAB[]
EXCEPTIONS
NOTFOUND = 1.
IF SY-SUBRC = IF_GC-FOUND.
LOOP AT CT_GT_LINETAB.
STRG = CT_GT_LINETAB-TDLINE.
IF STRG1 <> ' '.
CONCATENATE STRG1 ';' STRG INTO STRG1.
ELSE.
STRG1 = STRG.
ENDIF.
ENDLOOP.
CF_GV_TEXT_OUTPUT_LINE-LTXT40 = STRG1.
APPEND CF_GV_TEXT_OUTPUT_LINE TO CT_GT_TEXT_OUTPUT_LINE.
CLEAR CF_GV_TEXT_OUTPUT_LINE.
STRG1 = ' '.
ELSE.
APPEND CF_GV_TEXT_OUTPUT_LINE TO CT_GT_TEXT_OUTPUT_LINE.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDIF.
ENDFORM. " get_mat_text
*& Form data_output
* Daten mit ALV ausgeben
* <->ct_GT_FIELDCAT Feldkatalog für ALV
* <->ct_gt_text_output_line Ausgabetabelle
* -->P_GS_LAYOUT Layout für ALV
* -->if_gc Globale Konstanten
* <--cf_GV_REPID Zur Zeit aufgerufener Reportname
* <--cf_gv_fieldcat Struktur Feldkatalog
* <--cf_gv Globale Variablen
FORM DATA_OUTPUT.
PERFORM FIELDCATBUILD.
PERFORM LAYOUT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GV-REPID
I_CALLBACK_PF_STATUS_SET = 'EVENT_SET_STATUS_01'
I_CALLBACK_USER_COMMAND = 'EVENT_USER_COMMAND'
IS_LAYOUT = L_LT
IT_FIELDCAT = T_FLDCAT1[]
TABLES
T_OUTTAB = <FS_2>
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> GC-FOUND.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " data_output
*& Form fieldcatbuild
* text
* --> p1 text
* <-- p2 text
FORM FIELDCATBUILD. " TABLES ct_gt_fieldcat_in STRUCTURE gv_fieldcat.
LOOP AT IT_FLDCAT INTO WA_IT_FLDCAT.
WA_IT_FLDCAT1-FIELDNAME = WA_IT_FLDCAT-FIELDNAME.
WA_IT_FLDCAT1-TABNAME = WA_IT_FLDCAT-TABNAME.
WA_IT_FLDCAT1-SELTEXT_L = WA_IT_FLDCAT-FIELDNAME.
APPEND WA_IT_FLDCAT1 TO T_FLDCAT1.
CLEAR : WA_IT_FLDCAT,WA_IT_FLDCAT1.
ENDLOOP.
ENDFORM. " fieldcatbuild
* Form event_set_status_01*
FORM EVENT_SET_STATUS_01 USING LT_EXCL TYPE SLIS_T_EXTAB.
SET PF-STATUS 'ABCD' .
ENDFORM. "EVENT_SET_STATUS_01
*& Form Name: event_user_command *
*& Form Desc: For Handling USER_COMMAND *
FORM EVENT_USER_COMMAND USING
IF_UCOMM TYPE SY-UCOMM
IS_SELFIELD TYPE SLIS_SELFIELD.
CASE IF_UCOMM.
WHEN 'DOWNLOAD'.
PERFORM POPULATE_DOWNLOAD_TABLE.
DATA: L_LENGHT TYPE I.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'C:data.xls'
FILETYPE = 'ASC'
WRITE_FIELD_SEPARATOR = 'X'
TRUNC_TRAILING_BLANKS = 'X'
DAT_MODE = 'X'
IMPORTING
FILELENGTH = L_LENGHT
TABLES
DATA_TAB = <FS_22>.
IF SY-SUBRC <> GC-FOUND.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF L_LENGHT NE GC-FOUND.
MESSAGE S398(00) WITH 'DATA downloaded to c:data.xls'.
ENDIF.
ENDCASE.
ENDFORM. "event_user_command
*& Form get_lang
* text
* --> p1 text
* <-- p2 text
FORM GET_LANG.
SELECT SPRAS
LAISO FROM T002 INTO CORRESPONDING FIELDS OF TABLE GT_LANG
WHERE SPRAS IN S_LANG.
DESCRIBE TABLE GT_LANG LINES V_LINES.
LOOP AT GT_LANG INTO WA_GT_LANG.
V = V + 1.
WA_GT_LANG-SRNO = V.
MODIFY GT_LANG FROM WA_GT_LANG TRANSPORTING SRNO.
ENDLOOP.
LOOP AT GT_LANG INTO WA_GT_LANG.
CONCATENATE 'MATEDESC-' WA_GT_LANG-LAISO INTO V_FIELDNAME.
CLEAR WA_IT_FLDCAT.
WA_IT_FLDCAT-FIELDNAME = V_FIELDNAME.
WA_IT_FLDCAT-SELTEXT = V_FIELDNAME.
WA_IT_FLDCAT-DATATYPE = 'CHAR'.
WA_IT_FLDCAT-INTLEN = 40.
WA_IT_FLDCAT-TABNAME = '<FS_2>'.
APPEND WA_IT_FLDCAT TO IT_FLDCAT .
CLEAR WA_GT_LANG.
ENDLOOP.
LOOP AT GT_LANG INTO WA_GT_LANG.
CONCATENATE 'BASDAT-' WA_GT_LANG-LAISO INTO V_FIELDNAME.
CLEAR WA_IT_FLDCAT.
WA_IT_FLDCAT-FIELDNAME = V_FIELDNAME.
WA_IT_FLDCAT-DATATYPE = 'CHAR'.
WA_IT_FLDCAT-INTLEN = 255.
WA_IT_FLDCAT-SELTEXT = V_FIELDNAME.
WA_IT_FLDCAT-TABNAME = '<FS_2>'.
APPEND WA_IT_FLDCAT TO IT_FLDCAT .
CLEAR WA_GT_LANG.
ENDLOOP.
V_FIELDNAME = 'MATNR'.
CLEAR WA_IT_FLDCAT.
WA_IT_FLDCAT-FIELDNAME = V_FIELDNAME.
WA_IT_FLDCAT-DATATYPE = 'CHAR'.
WA_IT_FLDCAT-SELTEXT = 'Matnr'.
WA_IT_FLDCAT-INTLEN = 18.
WA_IT_FLDCAT-TABNAME = '<FS_2>'.
INSERT WA_IT_FLDCAT INTO IT_FLDCAT INDEX 1.
V_FIELDNAME = 'BEGRU'.
CLEAR WA_IT_FLDCAT.
WA_IT_FLDCAT-FIELDNAME = V_FIELDNAME.
WA_IT_FLDCAT-DATATYPE = 'CHAR'.
WA_IT_FLDCAT-SELTEXT = 'BEGRU'.
WA_IT_FLDCAT-INTLEN = 4.
WA_IT_FLDCAT-TABNAME = '<FS_2>'.
INSERT WA_IT_FLDCAT INTO IT_FLDCAT INDEX 2.
ENDFORM. " get_lang
*& Form dynamic_tables
* text
* --> p1 text
* <-- p2 text
FORM DYNAMIC_TABLES.
ASSIGN LT_DATA TO <FS_DATA>.
* Creating the Dynamic Internal Table
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = IT_FLDCAT " Fieldcatalogue
IMPORTING
EP_TABLE = <FS_DATA> " Dynamic Internal Table
EXCEPTIONS
GENERATE_SUBPOOL_DIR_FULL = 1
OTHERS = 2.
* Assign Dyn Table To Field Sumbol
ASSIGN <FS_DATA>->* TO <FS_1>.
* Assigning the Internal Table TYPE ANY to Standard internal Table
ASSIGN <FS_1> TO <FS_2>.
* Creating a Workarea
CREATE DATA LWA_LINE LIKE LINE OF <FS_2> .
* Assigning the Content to the workares as a Pointer
ASSIGN LWA_LINE->* TO <LWA_LINE_WA>.
ENDFORM. " dynamic_tables
*& Form populate_final_table
* text
* --> p1 text
* <-- p2 text
FORM POPULATE_FINAL_TABLE.
LOOP AT GT_TEXT_OUTPUT_LINE INTO GV_TEXT_OUTPUT_LINE.
READ TABLE GT_LANG INTO WA_GT_LANG
WITH KEY SPRAS = GV_TEXT_OUTPUT_LINE-SPRAS.
IF SY-SUBRC EQ GC-FOUND.
GV_TEXT_OUTPUT_LINE-SRNO = WA_GT_LANG-SRNO.
ENDIF.
MODIFY GT_TEXT_OUTPUT_LINE FROM GV_TEXT_OUTPUT_LINE.
ENDLOOP.
ENDFORM. " populate_final_table
*& Form populate_dynamic_table
* text
* --> p1 text
* <-- p2 text
FORM POPULATE_DYNAMIC_TABLE.
DATA: INDX TYPE SY-TABIX.
LOOP AT GT_TEXT_OUTPUT_LINE INTO GV_TEXT_OUTPUT_LINE.
AT NEW MATNR.
INDX = SY-TABIX.
ASSIGN COMPONENT 1 OF STRUCTURE <LWA_LINE_WA> TO <F>.
<F> = GV_TEXT_OUTPUT_LINE-MATNR.
ASSIGN COMPONENT 2 OF STRUCTURE <LWA_LINE_WA> TO <F>.
<F> = GV_TEXT_OUTPUT_LINE-BEGRU.
ENDAT.
LOOP AT GT_LANG INTO WA_GT_LANG.
IF GV_TEXT_OUTPUT_LINE-SRNO = WA_GT_LANG-SRNO.
V_VAR = GV_TEXT_OUTPUT_LINE-SRNO + 2.
ASSIGN COMPONENT V_VAR OF STRUCTURE <LWA_LINE_WA> TO <F>.
<F> = GV_TEXT_OUTPUT_LINE-MAKTX.
V_VAR = GV_TEXT_OUTPUT_LINE-SRNO + V_LINES + 2.
ASSIGN COMPONENT V_VAR OF STRUCTURE <LWA_LINE_WA> TO <F>.
<F> = GV_TEXT_OUTPUT_LINE-LTXT40.
ENDIF.
ENDLOOP.
AT END OF MATNR.
APPEND <LWA_LINE_WA> TO <FS_2>.
CLEAR <LWA_LINE_WA>.
ENDAT.
ENDLOOP.
ENDFORM. " populate_dynamic_table
*& Form LAYOUT
* text
* --> p1 text
* <-- p2 text
FORM LAYOUT.
CLEAR L_LT.
L_LT-ZEBRA = GC-YES.
L_LT-COLWIDTH_OPTIMIZE = 'X'.
L_LT-WINDOW_TITLEBAR = GC-TXT.
ENDFORM. " LAYOUT
*& Form populate_download_table
* text
* --> p1 text
* <-- p2 text
FORM POPULATE_DOWNLOAD_TABLE.
ASSIGN LT_DATA1 TO <FS_DATA1>.
CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = IT_FLDCAT " Fieldcatalogue
IMPORTING
EP_TABLE = <FS_DATA1> " Dynamic Internal table
EXCEPTIONS
GENERATE_SUBPOOL_DIR_FULL = 1
OTHERS = 2.
* Assign Dyn Table To Field Sumbol
ASSIGN <FS_DATA1>->* TO <FS_11>.
* Assigning the Internal Table TYPE ANY to Standard internal Table
ASSIGN <FS_11> TO <FS_22>.
* Creating a Workarea
CREATE DATA LWA_LINE1 LIKE LINE OF <FS_22> .
* Assigning the Content to the workares as a Pointer
ASSIGN LWA_LINE1->* TO <LWA_LINE_WA1>.
DATA: STRN1 TYPE STRING,
STRN2 TYPE STRING,
INDX TYPE SY-TABIX.
ASSIGN COMPONENT 1 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
<FA> = GC-MAT.
ASSIGN COMPONENT 2 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
<FA> = GC-AUT.
LOOP AT GT_LANG INTO WA_GT_LANG.
V_VAR1 = WA_GT_LANG-SRNO + 2.
CONCATENATE 'MATERIALDESCRIPTION-' WA_GT_LANG-LAISO INTO STRN1.
ASSIGN COMPONENT V_VAR1 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
<FA> = STRN1.
V_VAR1 = WA_GT_LANG-SRNO + V_LINES + 2.
CONCATENATE 'BASICDATA-' WA_GT_LANG-LAISO INTO STRN2.
ASSIGN COMPONENT V_VAR1 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
<FA> = STRN2.
ENDLOOP.
APPEND <LWA_LINE_WA1> TO <FS_22>.
CLEAR <LWA_LINE_WA1>.
APPEND <LWA_LINE_WA1> TO <FS_22>.
V_VAR1 = 0.
LOOP AT GT_TEXT_OUTPUT_LINE INTO GV_TEXT_OUTPUT_LINE.
AT NEW MATNR.
INDX = SY-TABIX.
ASSIGN COMPONENT 1 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
<FA> = GV_TEXT_OUTPUT_LINE-MATNR.
ASSIGN COMPONENT 2 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
<FA> = GV_TEXT_OUTPUT_LINE-BEGRU.
ENDAT.
LOOP AT GT_LANG INTO WA_GT_LANG.
IF GV_TEXT_OUTPUT_LINE-SRNO EQ WA_GT_LANG-SRNO.
V_VAR1 = GV_TEXT_OUTPUT_LINE-SRNO + 2.
ASSIGN COMPONENT V_VAR1 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
<FA> = GV_TEXT_OUTPUT_LINE-MAKTX.
V_VAR1 = GV_TEXT_OUTPUT_LINE-SRNO + V_LINES + 2.
ASSIGN COMPONENT V_VAR1 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
* STR = GV_TEXT_OUTPUT_LINE-LTXT40.
* SEARCH STR FOR ';'.
* DO.
* IF SY-SUBRC = 0.
* SPLIT STR AT ';' INTO STR1 STR.
* <FA> = STR1.
* APPEND <LWA_LINE_WA1> TO <FS_22>.
* SEARCH STR FOR ';'.
* CLEAR <LWA_LINE_WA1>.
* ELSE.
* EXIT.
* ENDIF.
* ENDDO.
* <FA> = STR.
* APPEND <LWA_LINE_WA1> TO <FS_22>.
<FA> = GV_TEXT_OUTPUT_LINE-LTXT40.
ENDIF.
ENDLOOP.
AT END OF MATNR.
APPEND <LWA_LINE_WA1> TO <FS_22>.
CLEAR <LWA_LINE_WA1>.
ENDAT.
ENDLOOP.
ENDFORM. " populate_download_table
thanks
Nitya -
Dynamic internal table and dynamic read statements.
Hi,
My Scenario :
I have two dynamic internal tables.
I am looping at one internal table and trying to read another table.
In the read statement how do I mention the key dyamically.
Example code below :
LOOP AT <dyn_table> ASSIGNING <dyn_wa>.
read second dynamic internal table.
enloop.
The key which I want use for reading say it is keyed in the selection criteria....
Also based on the value I read I want to modify the first internal table field value.
Remember I dont want to explicity mention the key
How do I do that?
Thanks
Krishna.Hi
U need to use the field-symbol, but u can't use a WHERE option, but u need to use the CHECK statament into the second loop:
LOOP AT <dyn_table> ASSIGNING <dyn_wa>.
LOOP AT <DYN_TABLE2> ASSIGNING <DYN_WA2>.
ASSIGN COMPONENT <COMPONENT> OF STRUCTURE <DYN_WA2> TO <FS>.
CHECK <FS> IN (=) .......
ASSIGN COMPONENT <COMPONENT> OF STRUCTURE <DYN_WA> TO <FS2>.
<FS2> = .......
EXIT.
ENDLOOP.
ENDLOOP.
Max -
Dynamic internal table and dynamic field catalog
hi
i need to decide the number of fields of the internal table at runtime
and then need to pass value to this internal table.
then i need to create the field catalog for this internal table (so here
field catalog is also dynamic) to display in alv.
how to achieve this dynamic internal table creation and dyanmic field catalog generationHi Ajay,
U can use the below code to create a dynamic internal table.
*adding the field names only once for the dynamic table .
MOVE 'PRCTR' TO gw_component-name.
gw_component-type ?= cl_abap_elemdescr=>get_string( ).
INSERT gw_component INTO TABLE gt_components.
MOVE 'RCNTR' TO gw_component-name.
gw_component-type ?= cl_abap_elemdescr=>get_string( ).
INSERT gw_component INTO TABLE gt_components.
MOVE 'RACCT' TO gw_component-name.
gw_component-type ?= cl_abap_elemdescr=>get_string( ).
INSERT gw_component INTO TABLE gt_components.
MOVE 'RYEAR' TO gw_component-name.
gw_component-type ?= cl_abap_elemdescr=>get_string( ).
INSERT gw_component INTO TABLE gt_components.
MOVE 'YTDBAL' TO gw_component-name.
gw_component-type ?= cl_abap_elemdescr=>get_string( ).
INSERT gw_component INTO TABLE gt_components.
MOVE 'OBAL' TO gw_component-name.
gw_component-type ?= cl_abap_elemdescr=>get_string( ).
INSERT gw_component INTO TABLE gt_components.
*get structure descriptor -> GR_STRUCTDESCR
gr_structdescr ?= cl_abap_structdescr=>create( gt_components ).
create work area of structure GR_STRUCTDESCR -> GR_WA
CREATE DATA gr_wa TYPE HANDLE gr_structdescr.
ASSIGN gr_wa->* TO <gw_wa>.
determine key components -> GT_KEYS
MOVE lv_value1 TO gw_key-name.
INSERT gw_key INTO TABLE gt_keys.
create descriptor for internal table -> GR_TABLEDESCR
gr_tabledescr ?= cl_abap_tabledescr=>create( p_line_type = gr_structdescr
p_table_kind = cl_abap_tabledescr=>tablekind_hashed
p_unique = abap_true
p_key = gt_keys
p_key_kind = cl_abap_tabledescr=>keydefkind_user ).
create internal table -> GR_ITAB
CREATE DATA gr_itab TYPE HANDLE gr_tabledescr.
ASSIGN gr_itab->* TO <gt_itab>.
CREATE DATA gr_itab LIKE STANDARD TABLE OF <gw_wa>.
ASSIGN gr_itab->* TO <gt_sttab>.
Now u r internal table named <gt_sttab> has been created with fields like RCNTR, PRCTR,RACCT, RYEAR etc whatever the field u need u can go ahead and create dynamically.
then by using the table <gt_sttab> u can create u r field catalog.
Regards,
Rose. -
Urgent help needed!! Layout table and Draw layout cell dissapeared.
I need some urgent help. I'm using CS3 but for a while my
Layout Table and Draw Layout Cell icons appear greyed and can't use
them at all. Is there any kind soul out there who knows how to fix
this? I'm going nuts trying all the possible options but none seem
to work.
Help please!!!!!!> How would you about designing a page without using html?
You don't. But I don't recall suggesting that you not use
HTML. I just
suggested that you use best-practice HTML, no? Or maybe you
meant to ask
how you would go about building your site without learning
HTML? In that
case, I think you are outta luck. Using DW without knowing
HTML is a very
punishing experience, I'm afraid.
> PS: A virtual box of 12 bottles of Moet Chandon is
already on your way!!
I'd prefer Cristal, please.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"Untersberg" <[email protected]> wrote in
message
news:g4tj9a$m5o$[email protected]..
> Ahhhhhh!!!!! They came up!!!! They came up again!!
> I was on standard mode. Now going back to your
suggestion, which I really
> appreciate. How would you about designing a page without
using html? I'm
> just
> redesigning my website at the moment and need it to get
going urgently,
> hence
> the reluctance to start learning HTML at the moment.
I'll do after but I
> need
> to get this up and running fairly quickly.
>
> Cheers.
>
> PS: A virtual box of 12 bottles of Moet Chandon is
already on your way!!
> -
Do We Need To Know All Tables and Fields inR/3
We are in the initial phase of BW development(We don't have Functional consltant with us).Our source System is R/3. According to Reporting requirement We have identified certain DataSources in Business Content Which have basic Characteristics and Key Figures which we require in report.
but still lot of fields are there in R/3 which we are not finding in Datasources ?. My question is Do we need to know for each Characteristic and key figure the base table in R/3 and corresponding field name in R/3.
We found certain fields are common in 4 - 5 Tables in R/3,So how do we know that certain field is coming from certain table only.
Here i want to ask, the Business content datasources in which we have certain chars and key figures which we require. do we need to know from which table these are comming or connected to in R/3??.
So the bottom line is ,do we need to see and analyse for each BEx report. what the corresponding field and table in R/3 is.
I would award points to rational answers.
regards
Srini----Hello Srini,
If all your requiremnts are fulfilled by the Business content objects, then you may impelement BW without going into much details in R/3. But that is a wishful thinking and doesn't happen in real scenario. Also, even if you implemented business content, while verifying the result you have to go the source system and compare the results.
In most of the projects, you need to enhance the business content delivered objects. While enhaching the datasources in R/3, you must know from which table to take the information. Many a times, the end users have R/3 experience and they tell you what information you are looking for, in that case life will be a bit easier. But if the user wants to see some information which is being captured as part of any particular transaction, you need to dig deep in R/3 to find out the table and how that can be extracted.
So, I would say at least little knowledge of R/3 is necessary. You may not need a full time functional consultant, but someone who has R/3 experience will be of great help.
Hope it helps.
Regards,
Praveen -
Hi plz help me to find out the table name and field names as i am unable to find .....In the spec am given requirements in the following pattern.
Description SAP-Term Explaination
1.Salesman Equipment AC Mgr. VBPA2 this is the salesman code - I need the
description for this.
2.Vendor MEPO_TOPLINE-SUPERFIELD Vendor field is pull from me23n where the
condition will be that COBL-KDAUF (this is a
structure from me23n in item data-account
assignment-sales order. The number here should
be the corresponding contract number. This field
should include a multiple selection function. User
can put more than one description to search for.
3. Val. Period Val. Period Category Val. Period Category from va41 header-contract
Category data. This field should include a multiple selection
function. User can put more than one description
to search for.
4. Service Order/ CAUFVD-GSTRP/ This should be the document date where by it is in
Purchase Order MEPO_TOPLINE-BEDAT between the range the user input
Document Date
5. B2B Vendor MEPO_TOPLINE-SUPERFIELD Vendor field is pull from me23n where the condition
will be that COBL-KDAUF (this is a structure from
me23n in item data-account assignment-sales
order. The number here should be the
corresponding contract number.
6. B2B Cost MEPO1211-NETPR This cost is pulled from PO (me23n) however take
note that the price will be pulled out base on line
item Net Price. Make sure that price is taken
corresponding only to the equipment tied to it.
Check on Number 7 to see how is the line item tied
to the equipment.
If this is in other currency please make it to SGD
with the exchange rate field Exchange rate
(MEPO1226-WKURS)
NOTE:: I need to know the table from which I can
determine the currency type as can be seen in the
ME23N transaction and also te exchange rate for
that particular currency.
7. No of faults The service order (CAUFVD-AUFNR) created base
on the equipment in Number 8. This should exclude
the service order of type RD08. Service order can be
access by IW33.
8. Faults Completed This would be the number of faults (Number 13)
which has a system status (CAUFVD-STTXT) of
TECO. System status can be viewed in IW33 Sys.
Status. Take note service order type RD08 will be
excluded
9. Time Spent on Fault AFVGD-ISMNW This field is in IW41 in confirmation base on the
order created. This field will be the actual time
spent. This will correspond to the Faults
Completed (Number 14). This means only orders
with system status TECO will be pull. Take not
service order type RD08 will be excluded
10. Fault Cost RIHAUFK_LIST- DGESKOSIST This will be the total cost for a service order which
have the status TECO. Those which are not TECO
will not be needed. This field can be obtain from
IW39 (standard report). Execute the report and
there will be a field for Total Actual Cost. You might
need to change the screen layout to be able to view
this. Take note service order type RD08 will be
excluded
11. PM Hours AFVGD-ISMNW This field is in IW41 in confirmation base on the
order created. This field will be the actual time
spent. This will correspond to the Faults Completed
This means only orders with system
status TECO will be pull. Take note service only
take order type RD08.
12. Spare Cost Spare part cost This field will be in IW33 under cost tab, and cost
PMCOEA-IKOSTENKGR tab in item level. This will be the actual cost of spare
part after TECO. This will include all order type.
13. Credit Note Credit Memo The programs need to pull out credit memo which is
reference from the contract. If there is a credit memo
reference from the contract then the value will be net
price per equipment.Can u tell me purpose of this spec ?
Regards,
pandu.
Maybe you are looking for
-
Changes to website do not appear on MY desktop (they do on others)
Hi, I have a website (not on a mac server, a .org address) which I set up and edit using iweb. When I update a page or create a new blog page, it updates the website but the new content does not show when I go to the website on my Imac. It does updat
-
Invoice verification (MM-IV) for bulk materials
Hi fellow SAP Experts, We have a specific requirement for the invoice verification around bulk materials. When ordering bulk material, we almost always receive a larger quantity than ordered. So the quantity on the GR is larger than the quantity on t
-
Acrobat will not start-up and mac osx and will not register
Acrobat is installed on my Mac Mini, but will not allow me to register with Adobe. Also, the same Acrobat 8 pro will not operate on my MacBook pro because it is not registered and does not recognize my serial# etc. How can I call someone at Adobe? Th
-
I want to reset my password.. But I don't know my security questions or the backup email password.. How can I reset my password? I do know my current password and I do have access to my account and make purchases with it occasionally.
-
Ive lost the 3D cube graphic when switching
Hi all, when switching from one user to another, it works, but the lovely 3D revolving cube transistion has dissapeared. Anyone come across this problem, or does anyone know of a solution to this problem?