Final Internal Table used in MIGO Transaction
Hi Experts,
I need to know the final internal table used in the MIGO transaction. Why I want to know this is, I need all the records which are there in the table control (GODYNPRO) of the MIGO transaction. I have used the BADI BADI MB_MIGO_BADI to read the values. But since it is a table control the values are getting changed when the user scrolls down the table control. How can I get all the values shown in this table control. Is there any global internal table in the SAPLMIGO program?
BR.
Hi ABAP,
Check the BADI MB_MIGO_BADI the example class CL_EXM_IM_MB_MIGO_BADI
In attributes tab variable GT_EXTDATA contains all migo positions.
Read the internal table to check items.
in this method the internal table is filled.
Therefore define your internal table in the class attributes.
I hope you help.
Similar Messages
-
Getting the final internal table of a transaction VA05
Hi,
Can anyone help me in getting the final internal table of a transaction VA05 when called from a program. I need to use to this internal table for further processing.
Thanks in advance,
Vinay.Hi,
Not quite sure what you are after but the following may help.
For a start VA05 uses FM RV_SALES_DOCUMENT_VIEW_3 to select it's data. Your program could simply call this. However, if you are doing a CALL TRANSACTION from your program to VA05 and you want to get the results back then you could utilise some 'old style' userexits available in VA05.
Two choices here:
1. At the end of FM RV_SALES_DOCUMENT_VIEW_3 there is a form END_MODIFICATION or
2. When VA05 calls RV_SALES_DOCUMENT_VIEW_3 it performs a user sort MV75AFZ1(MV75AFZ1)
Both of these belong to package VMOD which means you can modify them by simply registering the object in OSS (these are 'old style' exits before SMOD/CMOD and are prevelant in SD)
From either of these you could EXPORT to memory for when control is returned back to your program.
Thanks,
Pete -
ALV grid is not displaying few fields of final internal table of type DMBTR
hello frnds,
i am displaying 10 fields in ALV grid using field catalog.
among them five fields are currency fields on which i doing some arithematic operations. but all these fields are not getting displayed in alv grid.
here is my code....
declaring final strucutre to generate report
TYPES:BEGIN OF ty_final,
gjahr TYPE gjahr, " Year
wwert TYPE wwert_d, " Traslation date
bukrs TYPE bukrs, " company code
hkont TYPE hkont, " General ledger account
txt20 TYPE txt20_skat, " Account name
belnr TYPE belnr_d, " Purchase order number
shkzg TYPE shkzg, " Dt/Cr indicator
dmbtr1 TYPE dmbtr, " Ammount in local currency
v_alc TYPE dmbtr, " Ammount in local currency
wrbtr TYPE wrbtr, " Ammount in foreign currency
ebeln TYPE ebeln, " Purchase order number
ebelp TYPE ebelp, " Item number
matnr TYPE matnr, " Material number
menge TYPE menge_d, " Qunatity
meins TYPE meins, " Unit of measure
stprs TYPE stprs, " Std material master
v_iv TYPE dmbtr, " Invoice value
pswsl TYPE pswsl, " Currency
v_erc TYPE dmbtr, " Exchange rate calculated
v_op TYPE dmbtr, " Order price
v_uos TYPE dmbtr, " Unit order to stock
v_io TYPE dmbtr, " Invoice to order
v_uv TYPE dmbtr, " Unit value
v_t TYPE dmbtr, " Total
v_d TYPE dmbtr, " Differecne
netpr TYPE bprei, " Net price in purchasing document
v_total TYPE dmbtr, " Total
v_os TYPE dmbtr, " Order to stock
v_ito TYPE dmbtr, " Invoice to order
saknr TYPE saknr, " G/L account number
END OF ty_final.
FORM move_data.
IF NOT i_bseg[] IS INITIAL.
LOOP AT i_bseg INTO wa_bseg.
wa_final-gjahr = wa_bseg-gjahr.
wa_final-bukrs = wa_bseg-bukrs.
wa_final-hkont = wa_bseg-hkont.
wa_final-belnr = wa_bseg-belnr.
wa_final-shkzg = wa_bseg-shkzg.
wa_final-wrbtr = wa_bseg-wrbtr.
wa_final-ebeln = wa_bseg-ebeln.
wa_final-ebelp = wa_bseg-ebelp.
wa_final-matnr = wa_bseg-matnr.
wa_final-menge = wa_bseg-menge.
wa_final-meins = wa_bseg-meins.
wa_final-pswsl = wa_bseg-pswsl.
wa_final-dmbtr1 = wa_bseg-dmbtr.
wa_final-saknr = wa_bseg-saknr.
wa_final-v_total = wa_bseg-dmbtr.
READ TABLE i_bkpf INTO wa_bkpf WITH KEY bukrs = wa_bseg-bukrs.
IF sy-subrc = 0.
wa_final-wwert = wa_bkpf-wwert.
ENDIF.
CLEAR wa_bkpf.
READ TABLE i_mbew INTO wa_mbew WITH KEY matnr = wa_bseg-matnr.
IF sy-subrc = 0.
wa_final-stprs = wa_mbew-stprs.
ENDIF.
CLEAR wa_mbew.
READ TABLE i_ekpo INTO wa_ekpo WITH KEY ebeln = wa_bseg-ebeln.
IF sy-subrc = 0.
wa_final-netpr = wa_ekpo-netpr.
ENDIF.
CLEAR wa_ekpo.
READ TABLE i_skat INTO wa_skat WITH KEY saknr = wa_bseg-saknr.
IF sy-subrc = 0.
wa_final-txt20 = wa_skat-txt20.
ENDIF.
calculating output values
IF wa_bseg-shkzg = 'H'.
wa_final-v_alc = -1 * wa_bseg-dmbtr.
ELSEIF wa_bseg-shkzg = 'S'.
wa_final-v_alc = 1 * wa_bseg-dmbtr.
ENDIF.
DATA : l_c_v_alc TYPE p DECIMALS 2,
l_c_v_iv TYPE p DECIMALS 2.
l_c_v_alc = wa_final-v_alc.
IF wa_bseg-menge NE 0.
wa_final-v_iv = wa_bseg-dmbtr / wa_bseg-menge.
ENDIF.
IF wa_bseg-dmbtr NE 0.
wa_final-v_erc = wa_bseg-wrbtr / wa_final-dmbtr1.
ENDIF.
IF wa_final-v_erc NE 0.
wa_final-v_op = wa_ekpo-netpr / wa_final-v_erc.
ENDIF.
wa_final-v_uos = wa_mbew-stprs - wa_final-v_op.
wa_final-v_io = wa_final-v_iv + wa_final-v_uos.
wa_final-v_uv = wa_final-v_uos + wa_final-v_io.
wa_final-v_t = wa_final-v_uv + wa_bseg-menge.
wa_final-v_d = wa_final-v_t - wa_final-v_alc.
wa_final-v_os = wa_final-v_uos * wa_bseg-menge.
wa_final-v_ito = wa_final-v_io * wa_bseg-menge.
CLEAR wa_bseg.
APPEND wa_final TO i_final.
CLEAR wa_final.
ENDLOOP.
ENDIF.
ENDFORM. "data_retrieval
*& Form build_fieldcat
text
--> p1 text
<-- p2 text
FORM build_fieldcat.
CLEAR wa_fieldcat.
* TYPES : v_alc TYPE dmbtr. "curr. " decimal 2.
DATA: l_c_v_alc TYPE p DECIMALS 2,
l_c_v_iv TYPE p DECIMALS 2 .
l_c_v_alc = v_alc.
l_c_v_iv = v_iv.
Constant Declarations.
CONSTANTS:
l_c_gjahr(5) TYPE c VALUE 'GJAHR', " Year
l_c_wwert(5) TYPE c VALUE 'WWERT', " Traslation date
l_c_bukrs(5) TYPE c VALUE 'BUKRS', " company code
l_c_hkont(5) TYPE c VALUE 'HKONT', " General ledger account
l_c_txt20(10) TYPE c VALUE 'TXT20', " Account name
l_c_belnr(5) TYPE c VALUE 'BELNR', " Doc number
l_c_shkzg(5) TYPE c VALUE 'SHKZG', " Dt/Cr indicator
l_c_dmbtr(5) TYPE c VALUE 'DMBTR1', " Ammount in local currency
" l_c_v_alc TYPE c VALUE 'V_ALC', " Ammount in local currency
l_c_wrbtr(5) TYPE c VALUE 'WRBTR', " Ammount in foreign currency
l_c_ebeln(5) TYPE c VALUE 'EBELN', " Purchase order number
l_c_ebelp(5) TYPE c VALUE 'EBELP', " Item number
l_c_matnr(5) TYPE c VALUE 'MATNR', " Material number
l_c_menge(7) TYPE c VALUE 'MENGE', " Qunatity
l_c_meins(5) TYPE c VALUE 'MEINS', " Unit of measure
l_c_stprs(5) TYPE c VALUE 'STPRS', " Std material master
" l_c_v_iv(4) TYPE c VALUE 'V_IV', " Invoice value
l_c_pswsl(5) TYPE c VALUE 'PSWSL', " Currency
l_c_v_erc(5) TYPE c VALUE 'V_ERC', " Exchange rate calculated
l_c_v_op(4) TYPE c VALUE 'V_OP', " Order price
l_c_v_uos(5) TYPE c VALUE 'V_UOS', " Unit order to stock
l_c_v_io(4) TYPE c VALUE 'V_IO', " Invoice to order
l_c_v_uv(4) TYPE c VALUE 'V_UV', " Unit value
l_c_v_t(3) TYPE c VALUE 'V_T', " Total
l_c_v_d(3) TYPE c VALUE 'V_D', " Differecne
l_c_netpr(5) TYPE c VALUE 'NETPR', " Net price in purchasing document
l_c_v_total(7) TYPE c VALUE 'V_TOTAL', " Total
l_c_v_os(4) TYPE c VALUE 'V_OS', " Order to stock
l_c_v_ito(5) TYPE c VALUE 'V_ITO', " Invoice to order
l_c_saknr(5) TYPE c VALUE 'SAKNR', " G/L account number
l_c_i_final(7) TYPE c VALUE 'I_FINAL'. " Final internal table
Fieldcat for fiscal year
wa_fieldcat-col_pos = 1.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_gjahr.
wa_fieldcat-seltext_m = text-007.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Translation date
wa_fieldcat-col_pos = 2.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_wwert.
wa_fieldcat-seltext_m = text-008.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Company code
wa_fieldcat-col_pos = 3.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_bukrs.
wa_fieldcat-seltext_m = text-009.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for General ledger account
wa_fieldcat-col_pos = 4.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_hkont.
wa_fieldcat-seltext_m = text-010.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Account name
wa_fieldcat-col_pos = 5.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_txt20.
wa_fieldcat-seltext_m = text-011.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Doc number
wa_fieldcat-col_pos = 6.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_belnr.
wa_fieldcat-seltext_m = text-012.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Dt/Cr indicator
wa_fieldcat-col_pos = 7.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_shkzg.
wa_fieldcat-seltext_m = text-013.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Ammount in local currency
wa_fieldcat-col_pos = 8.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = 'DMBTR1'.
wa_fieldcat-seltext_m = text-014.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Ammount in local currency
wa_fieldcat-col_pos = 9.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = 'V_ALC'.
wa_fieldcat-seltext_m = text-015.
wa_fieldcat-ref_fieldname = 'DMBTR'.
wa_fieldcat-no_sign = 'X'.
wa_fieldcat-do_sum = c_x.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Ammount in foreign currency
wa_fieldcat-col_pos = 10.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_wrbtr.
wa_fieldcat-seltext_m = text-016.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Purchse order number
wa_fieldcat-col_pos = 11.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_ebeln.
wa_fieldcat-seltext_m = text-017.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Item No
wa_fieldcat-col_pos = 12.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_ebelp.
wa_fieldcat-seltext_m = text-018.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Material number
wa_fieldcat-col_pos = 13.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_matnr.
wa_fieldcat-seltext_m = text-019.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Qunatity
wa_fieldcat-col_pos = 14.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_menge.
wa_fieldcat-seltext_m = text-020.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Unit of measure
wa_fieldcat-col_pos = 15.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_meins.
wa_fieldcat-seltext_m = text-021.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Std material master
wa_fieldcat-col_pos = 16.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_stprs.
wa_fieldcat-seltext_m = text-022.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Invoice value,
wa_fieldcat-col_pos = 17.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = 'V_IV'.
wa_fieldcat-seltext_m = text-023.
wa_fieldcat-ref_fieldname = 'DMBTR'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Currency
wa_fieldcat-col_pos = 18.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_pswsl.
wa_fieldcat-seltext_m = text-024.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Exchange rate calculated
wa_fieldcat-col_pos = 19.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = 'V_ERC'.
wa_fieldcat-seltext_m = text-025.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Order price
wa_fieldcat-col_pos = 20.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_v_op.
wa_fieldcat-seltext_m = text-026.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Unit order to stock
wa_fieldcat-col_pos = 21.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_v_uos.
wa_fieldcat-seltext_m = text-027.
wa_fieldcat-do_sum = c_x.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Invoice to order
wa_fieldcat-col_pos = 22.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_v_io.
wa_fieldcat-seltext_m = text-028.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Unit value
wa_fieldcat-col_pos = 23.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_v_uv.
wa_fieldcat-seltext_m = text-029.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Total
wa_fieldcat-col_pos = 24.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_v_t.
wa_fieldcat-seltext_m = text-030.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Difference
wa_fieldcat-col_pos = 25.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_v_d.
wa_fieldcat-seltext_m = text-031.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Net Price in Purchasing Document
wa_fieldcat-col_pos = 26.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_netpr.
wa_fieldcat-seltext_m = text-032.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Total
wa_fieldcat-col_pos = 27.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_v_total.
wa_fieldcat-seltext_m = text-033.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Order to stock
wa_fieldcat-col_pos = 28.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_v_os.
wa_fieldcat-seltext_m = text-034.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
Fieldcat for Invoice to order
wa_fieldcat-col_pos = 29.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_v_ito.
wa_fieldcat-seltext_m = text-035.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
fieldcat for invoice to order
wa_fieldcat-col_pos = 30.
wa_fieldcat-tabname = l_c_i_final.
wa_fieldcat-fieldname = l_c_saknr.
wa_fieldcat-seltext_m = text-035.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. "build_fieldcatHi romanch,
defining the field catalog you must reference all currency fields to the respective currency key field (type CUKY).
<alv_fieldcat>-cfieldname = 'HWAER'.
This is sample for alv output of a currency field. The alv structure has a field HWAER which carries the currency key, e.g. USD or so.
Obviously you do not provide a cutrrency key for your values. If they are initial (zero), ALV will not display them as 0,00 but leave the field empty if the reference too currency key is not established.
If you define a DDIC structure for the ALV output this refernce is enforced. You can pass the DDIC structure name to the ALV and don not have to create the field catalog manually.
Regards,
Clemens -
Problem in filling the final internal table
Hi,
I am working on a code in which i have to fill up the final internal table which will store the values coming form different internal tables.Here's the code which i am trying to do but it is not giving the execat functionality.In this code ITOUTPUT is the final itab which is storing the values of all other internal tables.
Here's the code:-
loop at itab1.
select single maktx into v_item from makt where matnr = itab1-matnr.
ITOUTPUT-banfn = ITab1-banfn.
ITOUTPUT-badat = ITab1-badat.
ITOUTPUT-meins = ITab1-meins.
ITOUTPUT-menge = ITab1-menge.
ITOUTPUT-lfdat = ITab1-lfdat.
IF ITAB1-MEINS = 'KG'.
V_TOTREQ = V_TOTREQ + ITAB1-MENGE.
ELSEIF ITAB1-MEINS = 'TO'.
V_TOTREQ = V_TOTREQ + ( ITAB1-MENGE * 1000 ).
ELSEIF ITAB1-MEINS = 'G'.
V_TOTREQ = V_TOTREQ + ( ITAB1-MENGE / 1000 ).
ENDIF.
v_tpo = 0.
v_por = 0.
LOOP AT ITPO WHERE BANFN = ITAB1-BANFN AND bnfpo = ITAB1-bnfpo.
if v_por <> '0'.
write : / ' '.
endif.
ITOUTPUT-ebeln = ITPO-ebeln.
ITOUTPUT-aedat = ITPO-aedat.
ITOUTPUT-lifnr = ITPO-lifnr.
ITOUTPUT-menge = ITPO-menge.
ITOUTPUT-EINDT = ITPO-EINDT.
IF ITAB1-MEINS = 'KG'.
V_TOTPO = V_TOTPO + ITPO-MENGE.
ELSEIF ITPO-MEINS = 'TO'.
V_TOTPO = V_TOTPO + ( ITPO-MENGE * 1000 ).
ELSEIF ITPO-MEINS = 'G'.
V_TOTPO = V_TOTPO + ( ITPO-MENGE / 1000 ).
ENDIF.
v_tpo = v_tpo + itpo-menge.
v_tgr = 0.
v_por = 1.
v_grr = 0.
loop at itmrn where ebeln = itpo-ebeln and ebelp = itpo-ebelp.
if v_grr <> '0'.
write : / ' '.
endif.
select single budat from mkpf into v_grdate where MBLNR = itmrn-MBLNR.
write: 143 Itmrn-menge,v_grdate .
itoutput-PMENGE = itmrn-menge.
v_tgr = v_tgr + itmrn-menge.
v_grr = 1.
endloop.
p_po = itpo-menge - v_tgr.
write: 173 p_po.
ENDLOOP.
p_req = itab1-menge - v_tpo.
write : 195 p_req.
endloop.
loop at itoutput.
write:/ itoutput-banfn,12 itoutput-badat,24 v_item,50 itoutput-meins,53 itoutput-menge,itoutput-lfdat,
89 ITPO-ebeln,100 ITPO-aedat,111 ITPO-lifnr,(10) itpo-menge, ITPO-eindt.
MODIFY itoutput.
endloop.Hi,
Ok,i ha d checked my code by using your logic and giving the run time error ......
i had debugged my code (orignal onementioned in above thread with little modification) in which i am able to see that finaloutput (intrenal table) is getting filled properly and the problem arises when the cursor comes to the write statement ... it is repeating some of the values when output is displayed where as before displaying output this iternal table is having the correct data. i am using the following code :-
append itoutput.
ENDLOOP.
p_req = itab1-menge - v_tpo.
write : 195 p_req.
append itoutput. ,<--- added this
clear itoutput. <--- added this
endloop.
loop at itoutput.
write:/ itoutput-banfn,12 itoutput-badat,24 v_item,50 itoutput-meins,53 itoutput-menge,itoutput-lfdat,
89 ITPO-ebeln,100 ITPO-aedat,111 ITPO-lifnr,(10) itpo-menge, ITPO-eindt.
MODIFY itoutput. <------ not removed
endloop. -
Populate Final internal table from Dynamic internal table
Hello,
I have ti display data in ALV grid whose structure is fixed. I am dynamically selecting data iin an internal table.
Now from this dynamic internal table, i need to populate my final internal table whose structurte is fixed.
Please help.
Rgds,
HimanshuHello Himanshu,
When you say dynamic internal table there are two things one is the actual structure and other one is field table that holds information for all the fields used to create dynamic internal table.
No if you want to move data from dynamic table to fixed internal table then you can try as follows:
1.
field-symbols <field_name> TYPE C.
field-symbols <field_value> TYPE C.
Now you either use
LOOP AT fields_itab.
ASSIGN fields_itab-fieldname to <field_name>.
ASSIGN COMPONENT <field_name> OF STRUCTURE <structure_name> TO <field_value>
Now you move value from <field_value> to required field in fixed internal table.
i.e.
itab-fieldname = <field_value>.
Other way to do this:
If you fields order is constant then you can also use index in assign component statement.
do <no_of_fields> times.
ASSIGN COMPONENT sy-index OF STRUCTURE <structure_name> TO <field_value>.
rest is same as first method.
Hope this help!
I have given sudo code and you need to work on it little.
Thanks,
Augustin. -
Hi can any one tell me which tables are used in MIGO and if possible field names aslo .
Tables used in MIGO
CHVW Table CHVW for Batch Where-Used List
CHVW_IDX Batch Where-Used Index Table for Selection
IKPF Header: Physical Inventory Document
ISEG Physical Inventory Document Items
MARI Short document: material movement
MIGO_BADI_EXAMP2 BADI in MIGO: Example Table (Header)
MIGO_BADI_EXAMPL BADI in MIGO: Example Table
MIGO_BADI_HOLD MIGO BADI: Table for Held External Data
MIGO_CUST_ACTION MIGO: Control of Listbox Transaction
MIGO_CUST_FIELDS MIGO: Field Selection per Movement Type
MIGO_CUST_REFDOC MIGO: Control of Listbox Reference Documen
MIGO_CUST_TCODE MIGO: Transactions
MIGO_INIT Control Table for Operation in Transaction
MIGO_T156 Movement Types - Reference MIGO
MKPF Header: Material Document
MKPF_ARIDX Index table for single doc. access to arch
MMIM_PRED MM-IM Temporary Data
MMIM_PREDOC_ORG Parked Material Documents, Organizational
MMIM_REP_PRINT Print Settings, Reporting MM-IM
MMINKON Worklist for Inconsistent Materials
MMINKON_UP Corrections due to Technical Problems with
MSEG Document Segment: Material
MWCURM Customizing: MM Configuration
MWMKPF Header Table for the Interface
MWSTOR Reversal Transactions
MWXMSEG ZMSEG: Interface for Posting of Value
MWXVM07M Fields: Update Control of Module Pool SAPM
MWYMBUZ Line Assignment
MWZDM07M1 ZDM07M1
MWZDM07M2 ZDM07M2
MWZMBUZ ZMBUZ
MWZMSEG ZMSEG:Interface for Posting of Value
MWZVM07M Fields: Update Control of Module Pool SAPM
RESB Reservation/dependent requirements
RKPF Document Header: Reservation
RPGRI Texts for grouping of movement types
SBSE Stock Mngmt Levels for Inventory Sampling
SKPF Header Data: Inventory Sampling
SLGH Elements of Stock Population
SSCH Strata of Inventory Sampling
T003M Transaction/Event Types for SAPMM07M/SAPMM
T043I Tolerance Groups for Persons Processing In
T063 Screen Control: Inventory Management
T063C Call-Screen Control: Inventory Management
T063D Screen Control: View in Inventory Manageme
T063F Function Codes: Inventory Management
T063O OK Codes in Inventory Management
T063T Transactions Called Up From Inventory Mana
T064A Physical Inventory Stock Types
T064B Stock Types and Texts for Physical Invento
T064F Function Codes: Physical Inventory
T064S Stock Mngmt Levels for Inventory Sampling
T064T Physical Inventory: Texts
T134H Organiz. Unit: Business Area Determ. - MM
T134M Control of Qty/Value Update
T150 Physical Inventory Stock Types and Allocat
T150F Stock Types and Allocated Fields in Physic
T156 Movement Type
T156B Movement Types: Screen Selection
T156C Stock Types and Their Values
T156F Fields in Quantity String
T156H Help Texts for Movement Type (up to Rel. 2
T156HT Main Text for Movement Type
T156K Account Assignment Fields in Field Selecti
T156M Posting String: Quantity
T156N Next Movement Type
T156S Movement Type: Quantities/Value Posting (U
T156SC Mvt Type: Qty/Value Posting: Customer Tabl
T156SY Mvt Type: Qty/Value Update: System Table;
T156T Movement Type Text
T156V Availability Table
T156W Posting string values
T156X Trans./Event Key Modification
T157B Descr. of Qty Fields (Plant Stock Avail.,
T157D Reason for Movement
T157E Text Table: Reason for Movement
T157F Display Fields: Plant Availability
T157H Help Texts for Movement Types
T157N Fields in Stock Balance Display (Inventory
T157O Routine Selection for Plant Availability
T157P Display Rules
T157Q Inventory Mgmt.: Display Rules for Plant S
T157R Display Rule for Availability Block
T157T Description of Fields in Availability Bloc
T158 Transaction Control: Inventory Management
T158B Check Table: Movement Type for Transaction
T158G MMIM: Possible Codes for BAPI Goods Moveme
T158I Transaction Control: Physical Inventory
T158N Next Transaction Code in Inventory Managem
T158T Inv. Management: Text Table for Trans./Eve
T158V Inv. Mngmt - General: Transaction/Event Ty
T158W Long Text for Transaction/Event Type
T159A Test Data for Batch Input in Inventory Man
T159B Parameters for Batch Inputs in Inventory M
T159C Value table for counting cycles in cycle c
T159E IM Print Func.:Determ.No.of Copies f. Labe
T159F MMIM: Error Messages Resulting From Blocke
T159G Default Values for Inventory Sampling Prof
T159H Long Text for Inv. Sampling Profile
T159I Test Data for Batch Input in Inventory Man
T159L Default values for inventory management an
T159M Inv. Managmt Print Function: Active Form V
T159N Invent. Mgmt Print Function: Active Form V
T159O Inv. Mngmt Print Function: Maintain Text N
T159P Parameters for Printing GR/GI Slips
T159Q Inventory Management Print Function: Value
T159R IM Document Reorganization - Life of Docum
T159S Inventory Mgmt Print Function: Printer Com
T159T Invntry Mgmt. Printing: Text Table for Tab
T159X Inventory Management: XAB numer range dete
T159Z Inventory Management: XAB number range
TNAD9 Output Determination: Printer per SLoc. an
TXSTA MM Inventory Mngmt: Work Table for Phys. I
Pl reward if useful
Narendra -
Need to update Ztable from final internal table
Hi,
ITAB = Final internal table has 9 fields : 1 2 3 4 5 6 7 8 9
Ztable = Ztable has 6 fields ex : 1 3 4 6 7 8
Structure of both Itab and Ztable are different.
I have data in the Final Internal table and needs to update data into a ztable.
If condition is true...
Modify ztable from itab
endif.
Any suggestions how I can update Ztable from the INternal table
Regards,
KittuHello,
First keep the loop to the final internal table then move all the records to the work area after moving to workarea then create another workarea for the Ztable then move only the field values which are there in Ztable then use modify keyword.
example
move:
y_wa_final_itab-kdauf to y_wa_zhr_item-vbeln,
y_wa_final_itab-kdpos to y_wa_zhr_item-posnr,
y_wa_final_itab-receiptno to y_wa_zhr_item-receiptno
modify zhr_item from y_wa_zhr_item -
Final internal table for me2j ?
Dear ABAPers,
I added extra field in MEREP_OUTTAB_ACCOUNTING structure.(Append-wrbtr)
now i need final internal table which is used to populate the me2j report?
so tell me the final internal table of me2j .
please help me!
Regards,
Praphull
Moderator Message: Duplicate Post.
Edited by: kishan P on Dec 26, 2011 3:28 PMDear Madhu,
thanks for guidence!
its showing popup tht this BADI ( ME_CHANGE_OUTTAB_CUS ) is only use for "SAP Internal use".
Regards,
Praphull -
To eliminate the duplicate entries while looping into final internal table
Hi friends,
IAam facing the follwoing problem.
Get Shipment for the Delivery number
SELECT tknum
vbeln
INTO TABLE lt_vttp
FROM vttp
FOR ALL ENTRIES IN lt_vbfa
WHERE vbeln = lt_vbfa-vbelv.
IF sy-subrc EQ 0.
SELECT vbeln kunnr
FROM likp
INTO TABLE lt_likp
FOR ALL ENTRIES IN lt_vttp
WHERE vbeln = lt_vttp-vbeln.
endif.
now iam my internal table lt_vttp i have following values
shipment delivery
1000 2000
1000 2001
in my internal table lt_likp i have the follwoing values
delivery shipto
2000 ABC
2001 ABC
now iam looping those values in a final internal table.
LOOP AT lt_likp INTO ls_likp.
CHECK sy-subrc EQ 0.
READ TABLE lt_vttp INTO ls_vttp WITH KEY vbeln = ls_likp-vbeln BINARY SEARCH.
CHECK sy-subrc EQ 0.
SELECT SINGLE * FROM vttk INTO ls_vttk
WHERE tknum = ls_vttp-tknum.
CHECK sy-subrc EQ 0.
APPEND ls_vttk TO lt_vttk.
endloop.
Now my problem is if the shipment is same and the shipto is same then need to eliminate the duplicate records.
in internal table iam getting 2records with same shipment and shipto combination.
but instead if both the shipment and shipto are same then i should elimate the duplicate entries.
and for the same shipment if i have differnt shipto then i neeed those 2 value.
can any body tell me how can i get that.
Regards
Priyanka.Hi Priyanka,
In your code you are using seelct statement inside the loop which will affect the performance.
So, declare a another internal table which contains your both shipment and shipto elements with other required fields, say the name is lt_new.
sort lt_new by shipment shipto.
delete adjacent duplicates from lt_new comparing shipment shipto.
"then use for all entries to choose values from VTTK.
Hope this helps you.
Regards,
Manoj Kumar P -
Sending data from final internal table to application server in xml format
hi to all ,
can anyone send details about send data from final internal table to application server in xml format.right now i am able to download data to presentation server in xml format . love to here soon from all the abap gigs.welcome to SDN.
are you using call transformation to convert itab to XML? the XML string is in which format?
convert it to xstring and then use the following code to store it in application server.
OPEN DATASET fname FOR OUTPUT IN BINARY MODE.
TRANSFER XML_content TO FNAME.
CLOSE DATASET FNAME.
where fname is the path to the file name.
Regards
Raja -
How to Upload Excel sheet in DB or internal table using SAP NetWeaver ABAP
Dear All experts,
Pls provide guidance to Upload Excel sheet in DB or internal table using ABAP in ( SAP NetWeaver stack )
Regards
Machindra
Edited by: Machindra Patade on Apr 8, 2010 3:07 PMPlease search before posting.
Thread locked.
Thomas -
Table used in the Transaction OOER or External Trainer
Can any body help in finding out the standard tables used in the transaction OOER or To add External Trainder.
Hi,
Below declaration is there in the transaction code.
Hope this helps you.
TABLES : hrvpv6a, "screen parameters Dynpro 2000 / 3000
hrp1000, "database for P1000 (SYS_CHECK_SHORT)
hrp1023, "database for P1023 (Dynpro 4200)
t005t, "country names
t522t, "address-forms
t535n, "name addings
t777a, "show these addresses for buildings
t778p, "#EC NEEDED "allow these planversions
q1023, "help structure for relations
p1023, "help structure for relations
pad21, "help structure for relations
pad22, "help structure for relations
pad31, "help structure for relations
pad77, "help structure for relations
pkeyk, "help structure for cost centers
indx . "database for user settings -
How to extract data from info cube into an internal table using ABAP code
HI
Can Anyone plz suggest me
How to extract data from info cube into an internal table using ABAP code like BAPI's or function modules.
Thankx in advance
regds
AJAYHI Dinesh,
Thankq for ur reply
but i ahve already tried to use the function module.
When I try to Use the function module RSDRI_INFOPOV_READ
I get an information message "ERROR GENERATION TEST FRAME".
can U plz tell me what could be the problem
Bye
AJAY -
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 -
Problem in move the data to final internal table.
hi,
iam having 3 internal table.
1. g_t_vbrk (having data for vbrk table)
2. g_t_vbak (having data for vbak table)
3. g_t_likp (having data for likp table.)
actually i have written the loop like below .
LOOP AT g_t_vbrk.
READ TABLE g_t_vbfa WITH KEY vbeln = g_t_vbrk-vbeln.
IF sy-subrc = 0.
MOVE : g_t_vbrk-vbeln TO g_t_output_raw_header_data-vbeln,
g_t_vbrk-taxk1 TO g_t_output_raw_header_data-taxk1,
g_t_vbrk-taxk4 TO g_t_output_raw_header_data-taxk4,
g_t_vbrk-fkart TO g_t_output_raw_header_data-fkart,
g_t_vbrk-inco1 TO g_t_output_raw_header_data-inco1,
g_t_vbrk-inco2 TO g_t_output_raw_header_data-inco2,
g_t_vbrk-zterm TO g_t_output_raw_header_data-zterm,
g_t_vbrk-kunag TO g_t_output_raw_header_data-kunag.
READ TABLE g_t_vbak WITH KEY vbeln = g_t_vbfa-vbelv.
IF sy-subrc = 0.
MOVE : g_t_vbak-vkorg TO g_t_output_raw_header_data-vkorg,
g_t_vbak-auart TO g_t_output_raw_header_data-auart,
g_t_vbak-spart TO g_t_output_raw_header_data-spart,
g_t_vbak-vtweg TO g_t_output_raw_header_data-vtweg.
ENDIF.
APPEND g_t_output_raw_header_data.
endloop.
my question is i want to move likp table lfdat field to that final internal table with same loop.
i want to write move statement with same loop.
pls help with coding wise.
thanks
santhoshHi
In the loop.
SELECT VBELN FROM VBFA
INTO V_VBELN
WHERE VBELV = G_I_VBRK-VBELN
AND VBTYP_N = 'M'
AND VBTYP_V = 'J'.
Now READ from your LIKP internal table.
READ TABLE G_I_LIKP WITH KEY VBELN = V_VBELN.
Write your MOVE statements here.
Regards
Surya.
Maybe you are looking for
-
Acrobat Reader 11.0.01 crashes after a few seconds
Hi, I am running mac os 10.8.2. Always after a few seconds Acrobat Reader 11.0.01 crashes. Does anybody have an idea how to solve this problem. I already reinstalled Acrobat. Here is the log: Process: AdobeReader [311] Path: /Appli
-
How to delete entries in an internal table except for one entry
Hi all, I have 4 records in my internal table and I need to delete all the records in the internal table except the last one.How do i do this?Any sample code? Thanks. Moderator message - Please do not ask or answer basic questions - thread locked Ed
-
Can't install OS 10.4.6 on my imac 5.1 with the install dvd.
I borrowed the install disk from a friend and tried to format the HD and start up from the new OS but it doesn't work. Is the disk specific to my friend's computer or is my computer too old to support the new OS? How can I format and start up my comp
-
Can't get to slideshow module in 1.3
I can't get to slideshow module in 1.3 "an error occurred when attempting to change modules". I am running Leopard 10.5.1. Can anyone help? Dan
-
Accounting document should get same number
HI, User want accounting document number same as invoice number.Is is possible with standard SAP?