Reg : Passing two internal table values in to final internal table
Dear Experts,
My first internal table looks like this,
Customer Name O/S
A Anu 5000
B Beema 2000
C Chitu 3000
My Second Internal table looks like this,
Customer InvNo InvDate Due
A 001 1/1/09 500
A 002 2/2/09 100
B 004 4/4/09 50
B 003 4/5/09 100
My final Internal table should be,
Customer Name O/s InvNo InvDate Due
A Anu 5000 001 1/1/09 500
002 2/2/09 100
B Beema 2000 004 4/4/09 50
003 4/5/09 100
Please help me with the code...
Hai,
Thanks...
I need to get the O/P like this,
Customer Name O/S InvNo Inv Date Due
A Anu 3000 001 1/11/09 50
002 2/2/09 100
003 3/3/09 30
Plz help
Similar Messages
-
Reg : Pass One Component's value to other component's value
Hi all,
I have the following code . Here I want to Pass :Pass One Component's value to other component's value
<af:image binding="#{backingBeanScope.backing_OText.i1}"
id="i1"
source="#{(SkinBean.skinFamily == 'MSIE_D2I3')?'/images/d2i3Logo.gif':'/images/UDR_logo.jpg'}"
shortDesc="Hello World"/>
<af:spacer width="100" height="10"
binding="#{backingBeanScope.backing_OText.s1}"
id="s1"/>
<af:outputText
binding="#{backingBeanScope.backing_OText.ot1}"
id="ot1"
inlineStyle=" font-weight:normal; font-size:32pt; font-family:Georgia, 'Times New Roman', times, Serif;"
value = *"Here I want to pass the value as 'Hello World' from The Image Component's ShortDesc"*
Please give me the solution .
Thanks inAdvance .since you already have the backing bean, you can try to set the value property to
#{backingBeanScope.backing_OText.i1.shortDesc}regards,
~Krithika -
Get the master table value based on multiple fact tables
I have an master table which has to filter data based on multiple fact tables
In the below sample, i need to get the list of MasterTable SId in an single query for fetching data from all the fact tables with an criteria.
Can u let me know the single query to handle the below situation
Select count(1) from dbo.DimMaster where sid in
(Select Master_sid from dbo.factsales where SalesDate < '20141231')
Select count(1) from dbo.DimMaster where sid in
(Select Master_sid from dbo.factPurchase where PurchaseDate < '20141231')
Select count(1) from dbo.DimMaster where sid in
(Select Master_sid from dbo.factSalary where SalaryDate < '20141231')
Select count(1) from dbo.DimMaster where sid in
(Select Master_sid from dbo.factMarket where MarketDate < '20141231')
ShanmugaRajPlease try below:
SELECT
(SELECT count(1)
FROM dbo.DimMaster
WHERE sid IN (
SELECT Master_sid
FROM dbo.factsales
WHERE SalesDate < '20141231'
)) as C1,
(SELECT count(1)
FROM dbo.DimMaster
WHERE sid IN (
SELECT Master_sid
FROM dbo.factPurchase
WHERE PurchaseDate < '20141231'
)) as C2,
(SELECT count(1)
FROM dbo.DimMaster
WHERE sid IN (
SELECT Master_sid
FROM dbo.factSalary
WHERE SalaryDate < '20141231'
)) as C3 ,
(SELECT count(1)
FROM dbo.DimMaster
WHERE sid IN (
SELECT Master_sid
FROM dbo.factMarket
WHERE MarketDate < '20141231'
)) as C4
-Vaibhav Chaudhari -
Table values are not passed to context.
Hi,
Im trying to build a online(WD ABAP) form with a BAPI which is having import, export and tables parameters.
I have binded Datasource with main node and Template source I have binded with the form which I created with the form interface using context fromBAPI. Then I got all importing and exporting parameters. And tables I have got under Changing Node of Data View in the form. But there is one other node called Data is created automatically under changing node and under that DATA node I got Table and under that I got again Data Node created and there I have all the attributes.
I dragged table on to the form. But when Im tesing the form by submitting, Im not getting table values which are entered in table. But all other values which are binded to importing parameters Im able to get the values.
Can some one tell me how to get the values from table to context? And can I have dynamic table in the form to map to the context so that I can update the data through BAPI?
Warm Regards,
J.Smitha.Hi,
Smitha, you can defnetly use dynamic table in interactive form. I had similar problem and I acheived like follwing:Basically you have to bind the table .
If you want to have fixed number of rows in the interactive form, then in wddoinit method bind the internal table to ur table node. for exmaple: if u want 2 rows in the form loop times . So by default when you open the form you will get two rows for the table.
**************BIND THE ITAB ****************************
DO 2 TIMES.
APPEND LW_LFBK TO LT_LFBK.
CLEAR LW_LFBK.
ENDDO.
CALL METHOD lo_nd_t_lfbk->bind_table
EXPORTING
new_items = LT_LFBK.
If you want to have dynmic table then take a submit button in the form instead of normal button,
in onaction submit write a loop every time you click that new submit button it should add a new row.
use above coding in onactionsubmit instead of doinit.
Thats it.
Regards,
Ravi -
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 moving the data into final internal table
Hello all,
I am stuck in apeculair situation.
I have a internal table having header record and a internal table having its line items.
Header record :: 90006103 A 20080110 ALBERTA 3456
Detail record :: 90006103 D2 2219CR1710441
90006103 D2 2219M11710443
90006103 D2 2219M21710442
90006103 A 20080115 ALBERTA 3456
90006103 D2 2219CR1710441
90006103 D2 2219M11710443
90006103 D2 2219M21710442
I collected the header record in one internal table and another internal table having all the line items.But the problem is when i am moving the values to the final inernal table i am getting the same payment date
20080110 (Date field in first record of header internal table) for all the line items .
But my requirement is that date should be 20080110 for the first 3 line items of first header record and similarly date should be 20080115 for all the line items of the next header record.
Kindly suggest.
Regards,
Arunassumption: some mistake in ur posting that, How belnr and date r same for both header records, so i guess, either one is different.
try with AT NEW - ENDAT.
AT NEW belnr.
here use looping, READing of ur itabs.---> so, u need to build couple of itabs to move forth and back.
ENDAT.
pls. note that, when u use this AT NEW all the CHAR fileds of itab wuld show as STARS **.....so, this is the necessity behind building new itabs.
thanq
Edited by: SAP ABAPer on Dec 30, 2008 6:24 PM -
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 -
How to write table values into a configuration file
Im writing some values in the table, i want to save and load the table values, how to save the table configuration into configuration file??
Pls ignore my prev post, I cud not finish edit within 10 mins as req by the forum rule...
If you are not able to access a VI front panel at all when another VI is called by the first VI, then probably the issue is that the VI properties is set to be Modal. Right click on the VI icon on the right top corner and select VI Properties. Under Window Appearance, you can click on Customise button and ensure the VI is not Modal (and Custom is selected). Before this, you need to ensure the calling VIs are also not set to Modal (I think if you set it to dialog, it will be Modal by def. So don't use that as well). If any of the parent VI is set to Modal and a subsequent child VI is in non-modal mode, then you will not be able to access the child VI front panel when called and may end up with forcing the program to close.
Probably you may also need to have a different independant loop looking for the events. For this you may need to use Q structure as well, so that you can define a Q outside both loops, add elements to Q as and when the menu is selected within the loop for menu events, while the other loop works according to the Q elements it gets to remove.
Hope that helps ! -
Problem in moving to final interanl table
Hi all,
i have one problem when moving all the fileds in final internal table
t_eina is the final internal table
i want to itab-matnr and maktx in t_eina or anyother final internal please correct the code according to htis requriment.if any one is intrested
tables: ztab2,mara,mvke,MARAV,eina.
DATA: BEGIN OF T_ztab2 OCCURS 0,
MTART LIKE ztab2-MTART,
dwerks like ztab2-dwerks,
END OF T_ztab2.
DATA: BEGIN OF T_mara OCCURS 0,
matnr like MARAV-matnr,
maktx like MARAV-maktx,
MTART LIKE ztab2-MTART,
dwerks like ztab2-dwerks,
prat1 like mvke-prat1,
lifnr like eina-lifnr,
END OF T_mara.
DATA: BEGIN OF itab OCCURS 0,
matnr like MARAV-matnr,
maktx like MARAV-maktx,
MTART LIKE ztab2-MTART,
dwerks like ztab2-dwerks,
prat1 like mvke-prat1,
lifnr like eina-lifnr,
END OF itab.
Data : begin of t_eina occurs 0,
matnr like eina-matnr,
lifnr like eina-lifnr,
Mtart like mara-mtart,
dwerk like mvke-dwerk,
maktx like marav-maktx,
end of t_eina.
*data: begin of itab occurs 0,
matnr like marav-matnr,
mtart like marav-mtart,
maktx like marav-maktx,
end of itab.
*DATA ITAB LIKE STANDARD TABLE OF MARAV WITH HEADER LINE .
select * from ztab2 into corresponding fields of table t_ztab2 .
select amatnr amaktx amtart ddwerk d~prat1 into table t_mara
from MARAV as a inner join mvke as d on amatnr eq dmatnr
for all entries in t_ztab2 where a~mtart eq t_ztab2-mtart
and d~dwerk = t_ztab2-dwerks.
select amatnr amaktx amtart ddwerk d~prat1 into table itab
from MARAV as a inner join mvke as d on amatnr eq dmatnr
where a~mtart = 'Z030'.
SORT T_MARA BY MATNR.
Select matnr LIFNR from EINA into corresponding fields of table t_EINA
for all entries in t_MARA Where matnr = t_MARA-matnr.
*select * from marav into corresponding fields of table ITAB where mtart = 'Z030'.
SORT T_EINA BY MATNR.
loop at t_EINA.
Read table t_MARA with key matnr = t_EINA-matnr.
move t_mara-mtart to t_eina-mtart.
move t_mara-matnr to t_eina-matnr.
move t_mara-dwerks to t_eina-dwerk.
move t_mara-maktx to t_eina-maktx.
modify t_eina transporting mtart matnr dwerk maktx.
endloop.
<u></u>instead of modifying just use append t_eina.
-
Passing Dynamic Internal Table values to another program
Hi,
I have a program ZSAPNEW.
In this I have created a Dynamic internal table <fs_emp>. The number of fields differ for each run. The values are passed into <fs_emp> in this program. Now I need to submit thsi program from a main program ZHEAD and then display the values got from ZHEAD. For this I need to access the values retrieved from ZSAPNEW in <fs_emp> in ZHEAD. I cant figure out how to do this. I tried IMPORT ing the reference of teh field symbol too/ But its not allowing references in IMPORT/EXPORT. And since the table is of type ANY( as structure varies) I cant assign it to an internal table and then pass. Can some one suggest a solution please.
SuzieHi
You need to know how the strcture of your table is generated In both programm:
- Calling program:
DATA: LR_VALUE_DESCR TYPE REF TO CL_ABAP_ELEMDESCR,
COMPONENT TYPE CL_ABAP_STRUCTDESCR=>COMPONENT,
LT_COMPONENTS TYPE CL_ABAP_STRUCTDESCR=>COMPONENT_TABLE.
DATA: LT_STRUC TYPE REF TO CL_ABAP_STRUCTDESCR,
LT_TAB TYPE REF TO CL_ABAP_TABLEDESCR.
DATA: L_INDEX TYPE C.
DATA: W_LINE TYPE REF TO DATA,
INT_TABLE TYPE REF TO DATA.
FIELD-SYMBOLS: <WA> TYPE ANY,
<ITAB> TYPE TABLE,
<VALUE> TYPE ANY.
DO 4 TIMES.
CLEAR COMPONENT.
MOVE SY-INDEX TO L_INDEX.
CONCATENATE 'FIELD' L_INDEX INTO COMPONENT-NAME.
MOVE CL_ABAP_ELEMDESCR=>GET_C( P_LENGTH = 4 ) TO LR_VALUE_DESCR.
COMPONENT-TYPE = LR_VALUE_DESCR.
INSERT COMPONENT INTO TABLE LT_COMPONENTS.
ENDDO.
* Workarea
LT_STRUC = CL_ABAP_STRUCTDESCR=>CREATE( P_COMPONENTS = LT_COMPONENTS
P_STRICT = 'X' ).
CREATE DATA W_LINE TYPE HANDLE LT_STRUC.
ASSIGN W_LINE->* TO <WA>.
* Table
LT_TAB = CL_ABAP_TABLEDESCR=>CREATE( P_LINE_TYPE = LT_STRUC ).
CREATE DATA INT_TABLE TYPE HANDLE LT_TAB.
ASSIGN INT_TABLE->* TO <ITAB>.
DO 3 TIMES.
CLEAR <WA>.
DO 4 TIMES.
MOVE SY-INDEX TO L_INDEX.
CONCATENATE 'FIELD' L_INDEX INTO COMPONENT-NAME.
ASSIGN COMPONENT COMPONENT-NAME OF STRUCTURE <WA> TO <VALUE>.
MOVE SY-INDEX TO <VALUE>.
ENDDO.
APPEND <WA> TO <ITAB>.
ENDDO.
DATA: WA_INDX TYPE INDX.
WA_INDX-USERA = SY-UNAME.
WA_INDX-PGMID = 'MAXMAX'.
EXPORT TAB = <ITAB>
TO DATABASE INDX(XY)
FROM WA_INDX
CLIENT SY-MANDT
ID 'TABLE'.
Called program:
DATA: LR_VALUE_DESCR TYPE REF TO CL_ABAP_ELEMDESCR,
COMPONENT TYPE CL_ABAP_STRUCTDESCR=>COMPONENT,
LT_COMPONENTS TYPE CL_ABAP_STRUCTDESCR=>COMPONENT_TABLE.
DATA: LT_STRUC TYPE REF TO CL_ABAP_STRUCTDESCR,
LT_TAB TYPE REF TO CL_ABAP_TABLEDESCR.
DATA: L_INDEX TYPE C.
DATA: W_LINE TYPE REF TO DATA,
INT_TABLE TYPE REF TO DATA.
FIELD-SYMBOLS: <WA> TYPE ANY,
<ITAB> TYPE TABLE,
<VALUE> TYPE ANY.
DO 4 TIMES.
CLEAR COMPONENT.
MOVE SY-INDEX TO L_INDEX.
CONCATENATE 'FIELD' L_INDEX INTO COMPONENT-NAME.
MOVE CL_ABAP_ELEMDESCR=>GET_C( P_LENGTH = 4 ) TO LR_VALUE_DESCR.
COMPONENT-TYPE = LR_VALUE_DESCR.
INSERT COMPONENT INTO TABLE LT_COMPONENTS.
ENDDO.
* Workarea
LT_STRUC = CL_ABAP_STRUCTDESCR=>CREATE( P_COMPONENTS = LT_COMPONENTS
P_STRICT = 'X' ).
CREATE DATA W_LINE TYPE HANDLE LT_STRUC.
ASSIGN W_LINE->* TO <WA>.
* Table
LT_TAB = CL_ABAP_TABLEDESCR=>CREATE( P_LINE_TYPE = LT_STRUC ).
CREATE DATA INT_TABLE TYPE HANDLE LT_TAB.
ASSIGN INT_TABLE->* TO <ITAB>.
DATA: WA_INDX TYPE INDX.
WA_INDX-USERA = SY-UNAME.
WA_INDX-PGMID = 'MAXMAX'.
IMPORT TAB = <ITAB>
FROM DATABASE INDX(XY)
TO WA_INDX
CLIENT SY-MANDT
ID 'TABLE'.
LOOP AT <ITAB> ASSIGNING <WA>.
WRITE: / <WA>.
ENDLOOP.
The sample above use IMPORT/EXPORT from database: if the called program can't know the structure of the dynaic table, you need to transfer it by the same way you transfer the data
Max -
Hi All,
I have written BDC, in which when i pass value for second screen "Description type field" it's passing '*************************' instead of internal table value.
It's picking correct value for first internal table value. Could anyone please give an idea why it's happening?
Please find the code:
LOOP AT it_record.
header data for BDC
AT NEW CLASS.
IF sy-tabix <> 1.
perform bdc_dynpro using 'SAPLCLMO' '7777'.
perform bdc_field using 'BDC_OKCODE'
'=SAVE'.
CALL TRANSACTION 'CLWM' USING bdcdata
MODE p_mode
UPDATE 'S'
MESSAGES INTO messtab.
clear : bdcdata[],bdcdata.
ENDIF.
perform bdc_dynpro using 'SAPLCLMO' '0200'.
perform bdc_field using 'BDC_CURSOR'
'RMCLM-CLASS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMCLM-CLASS'
it_record-class.
perform bdc_dynpro using 'SAPLCLMO' '7777'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RMCLM-KLBEZ'.
perform bdc_field using 'RMCLM-KLBEZ'
it_record-klbez.
perform bdc_field using 'RMCLM-STATU'
'1'.
perform bdc_dynpro using 'SAPLCLMO' '7777'.
perform bdc_field using 'BDC_OKCODE'
'=MERK'.
perform bdc_field using 'BDC_CURSOR'
'RMCLM-KLBEZ'.
perform bdc_field using 'RMCLM-KLBEZ'
it_record-klbez.
perform bdc_field using 'RMCLM-STATU'
'1'.
MOVE 1 TO IDX.
ENDAT.
line item data for BDC
perform bdc_dynpro using 'SAPLCLMO' '7777'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RMCLM-RELEV(02)'.
CONCATENATE 'RMCLM-MERKMA(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
it_record-merkma.
CONCATENATE 'RMCLM-RELEV(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
it_record-relev.
IDX = IDX + 1.
ENDLOOP.
Thanks,
UjjwalHi Ujjwal
The reason behind this is that you are using AT NEW.... ENDAT block in your coding.
When you use AT NEW field statements, the fields in the work area after the field get converted into ********.
Check values in your work area I_RECORD in debugging inside AT NEW statement and you will understand what I am saying.
In your case all the fields from header line of I_RECORDS which come after field CLASS are getting converted into *******,
hence the error.
Try using a temporary work area, say w_record. Pass value of I_record to w_record before AT NEW statement.
And use w_record-fields instead of I_record-fields. And your program should work. -
Regarding Passing two internal Tables from Driver Program to Smartform
hi all,
I am Passing Two Internal Tables from Driver Program to Smartform it is going to dump and message is showing like this " one of the parameters eded according to the interface description was not specified ".
When i am passing one Internal Table Output is coming Perfectly. Is there any restriction for passing of internal tables.
Regards
RamiHI,
Check the names specified in the smartfrom and FM whcih you are calling in the driver program. Both might be different.... -
How to pass internal table values to parameter
hi,
how to pass internal table values to parameter in selection screen.if is it possible means please sent codeings.
thanks.
stalin.hi,
tables : mara.
data : begin of itab_mara occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
end of itab_mara.
selection-screen : begin of block blk1 with frame title text-001.
parameters : p_matnr like mara-matnr.
selection-screen : end of block blk1.
select matnr ernam from mara into corresponding fields of itab_mara
where matnr = p_matnr.
loop at itab_mara.
write :/ itab_mara-matnr,
itab_mara-ernam.
endloop.
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo -
How to bind internal table values with RootUIElement(Table) from select Que
Hello Friends,
In my view Layout,there r two Input fields ,Submit button and Table... My concept is when user posting values in two input fields and clicking submit button means the result(more than one values) should be displayed in Table...
I written coding also but i dont know to bind internal table values with Table... My code as follows,
method onactionsearch .
data:
Node_Node_Flight type ref to If_Wd_Context_Node,
Elem_Node_Flight type ref to If_Wd_Context_Element,
Stru_Node_Flight type If_View1=>Element_Node_Flight ,
itab TYPE STANDARD TABLE OF sflight.
navigate from <CONTEXT> to <NODE_FLIGHT> via lead selection
Node_Node_Flight = wd_Context->get_Child_Node( Name = IF_VIEW1=>wdctx_Node_Flight ).
@TODO handle not set lead selection
if ( Node_Node_Flight is initial ).
endif.
get element via lead selection
Elem_Node_Flight = Node_Node_Flight->get_Element( ).
@TODO handle not set lead selection
if ( Elem_Node_Flight is initial ).
endif.
alternative access via index
Elem_Node_Flight = Node_Node_Flight->get_Element( Index = 1 ).
@TODO handle non existant child
if ( Elem_Node_Flight is initial ).
endif.
get all declared attributes
Elem_Node_Flight->get_Static_Attributes(
importing
Static_Attributes = Stru_Node_Flight ).
select * from sflight into CORRESPONDING FIELDS OF TABLE itab
WHERE carrid = Stru_Node_Flight-carrid and connid = Stru_Node_Flight-connid.
Node_Node_Flight->bind_table( new_items = itab ).
endmethod.
Plz reply me asap...!Hi,
What I understood from your coding is...
* navigate from <CONTEXT> to <NODE_FLIGHT> via lead selection
Node_Node_Flight = wd_Context->get_Child_Node( Name = IF_VIEW1=>wdctx_Node_Flight ).
You are reading values from the above node and binding the values to the same node.Am i right?
Did you take seperate context node for your input fields or binded the above context to the fields.If not then read the context attribute values which are binded to the carrid and connid then pass these values to select query.
One more thing is select cardinality 1..n for node NODE_FLIGHT since you are displaying more than one record.
Go through the some basic tutorials.Search in sdn you will it get.Already there is a tutorial in sdn which explains exactly what do you require.
Go throgh this link
Web Dynpro for ABAP: Tutorials for Beginners
Web Dynpro for ABAP: Tutorials for Beginners [original link is broken]
Edited by: suman kumar chinnam on Mar 26, 2009 10:50 AM -
Problem with passing table values to RFC
Hi all,
I am passing values in table in RFC. There are no import/export parameters in RFC. We are passing only tables.
There are two tables in the RFC I_Dept and I_Subdept. Initially RFC is executed for getting the Dept which works fine as for this there is no need to set in input table value. But to get sub department I need to set the dept in I_Dept and after executing RFC I should get values in table I_Subdept. The code is as below:
wdContext.nodeOutput_I_Dept().invalidate();
wdContext.nodeOutput_I_Subdept().invalidate();
Z_Bapi_Dept_Values_Input d_Input = new Z_Bapi_Dept_Values_Input();
wdContext.nodeZ_Bapi_Dept_Values_Input().bind(d_Input);
Zdept dept = new Zdept();
dept.setZname("Sales");
d_Input.addI_Dept(dept);
try
wdContext.nodeZ_Bapi_Dept_Values_Input().currentZ_Bapi_Dept_Values_InputElement().modelObject().execute();
wdContext.nodeZ_Bapi_Dept_Values_Input().nodeOutput().invalidate();
catch (WDDynamicRFCExecuteException e)
msgManager.reportException(e.toString(), true);
Is anything wrong in this code because even after executing the RFC the size of node I_Subdept() is zero. But the RFC works fine in the backend.
Regards,
JaydeepA typical misunderstanding when populating structured input data
via code is the following:
- You have bound a WD context node hierarchy to the model say
N1 > M1
->N2 > ->M2
where N1, N2 are WD Context nodes (N2 is child of N1) and M1, M2 are
model classes bound to the context nodes. Important: M1 has a relation
to M2 on the model side, means there is some method M1.setMyM2(M2)
(assuming the target role of the relation is called "MyM2").
- You create context elements for N1 and N2 which are bound to a model
class instances of M1 and M2 respectively.
Assuming that M1 is the "executable" model class (*_Input) and M2
represents an input structure needed, the M2-input will - using the
above approach - not be available on execution. Why? The relation on the
model side (MyM2) is not available if just maintaining it via the
context, i.e. context and model are not "in sync". As RFC execution is
done via the model the M2 input will not be available.
You best create complex/nested input structures on the model
side and then bind the top-level model object to the resp context node.
In the above sample this would be:
M1 m1ModelObject = new M1();
M2 m2ModelObject = new M2();
m1ModelObject.setMyM2(m2ModelObject);
Hope it helps!
Regards,
Sangeeta
Maybe you are looking for
-
How to close JFileChooser dialog only while using ESC key ?
Hi All, I am using a Frame and from this frame i am calling the JFileChooser via a JButton. and using JFileChooser ShowOpenDialog() for open and close . while doing ESC operation my Main Frame is getting closed with JFileChooser dialog. Can i close o
-
Hi, one of my daughters friends tried to access her ipod causing it to become disabled; i do not want her to lose all her photos, she accesses my itunes account which is on ICLOUD, will she lose all her data - can this be fixed? I do not think it has
-
I am trying to create an app with my new mac ,I am using xcode (new edition ) I have looked on you tube to see how you can add a URL but it only allows me to do it on the first page ?
-
No email client since FF 5 upgrade no matter what I do to try and fix it I can't get it back
my default email will not work, can't click on email links on websites, "send link" does not work. I have all my outlook settings set correctly. This all happened since upgrading to 5. FF also uses 100% of my CPU to open, before i even open any tabs,
-
I cant seem to get the latest version of itunes to download to my pc
why is the latest version of itunes freezing when i try to download