How to modify internal table with new value after data processing
Hi,
My code is as below:
LOOP AT i_raw INTO wa_raw.
IF ( wa_raw-/BIC/ZOUASCLS = 'BA') OR ( wa_raw-/BIC/ZOUASCLS = 'CO' ) .
LOOP AT i_crrs INTO wa_crrs.
IF wa_raw-/BIC/ZOUIDCIF = wa_crrs-ZCBGCIFNO.
wa_raw-/BIC/ZOUINDAP = '03'.
ELSE.
wa_raw-/BIC/ZOUINDAP = '02'.
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.
Initially column /BIC/ZOUINDAP is empty and I want to populate either value '02' or '03' as shown above.
How do I insert those values into each i_raw records ?
Pls help!
Hello,
try this code:
IF ( i_raw-/BIC/ZOUASCLS = 'BA') OR ( i_raw-/BIC/ZOUASCLS = 'CO' ) .
LOOP AT i_raw INTO wa_raw.
WHERE wa_raw-/BIC/ZOUIDCIF = i_crrs-ZCBGCIFNO.
IF SY-SUBRC = 0.
wa_raw-/BIC/ZOUINDAP = '03'.
ELSE.
wa_raw-/BIC/ZOUINDAP = '02'.
APPEND wa_raw INTO i_raw.
ENDLOOP.
ELSE.
i_raw-/BIC/ZOUINDAP = ' '.
ENDIF.
Hope it helps.
Best regards.
Simone.
Similar Messages
-
How to get internal table with maximum value of a field in other internal
Let say I have an table itab consisting of:
itab-matnr = marm-matnr.
itab-umren = marm-umren.
itab-ean11 = marm-ean11.
there are many "ean11" for one "matnr"
How could I create itab2 with only "biggest" "ean11". could you give me examlpleHi,
data: mat_no type MATNR.
Loop at ITAB1.
IF mat_no = itab1-matnr.
here check the ean11 with previos ean11(Store it like matnr), and move the biggest one andf modify that row or move that in ITAB2 with a Modify statment, so that there will no second row with same material No
ENDIF.
MAT_NO = ITAB1-Matnr (Moving Itab1 material no to a Local field)
ENDLOOP.
Endloop. -
How to fill internal table with selection screen field.
Hi all,
i am new to sap . pls tell me how to fill internal table with selection screen field.Hi,
Please see the example below:-
I have used both select-options and parameter on the selection-screen.
Understand the same.
* type declaration
TYPES: BEGIN OF t_matnr,
matnr TYPE matnr,
END OF t_matnr,
BEGIN OF t_vbeln,
vbeln TYPE vbeln,
END OF t_vbeln.
* internal table declaration
DATA : it_mara TYPE STANDARD TABLE OF t_matnr,
it_vbeln TYPE STANDARD TABLE OF t_vbeln.
* workarea declaration
DATA : wa_mara TYPE t_matnr,
wa_vbeln TYPE t_vbeln.
* selection-screen field
SELECTION-SCREEN: BEGIN OF BLOCK b1.
PARAMETERS : p_matnr TYPE matnr.
SELECT-OPTIONS : s_vbeln FOR wa_vbeln-vbeln.
SELECTION-SCREEN: END OF BLOCK b1.
START-OF-SELECTION.
* I am adding parameter value to my internal table
wa_mara-matnr = p_matnr.
APPEND wa_mara TO it_mara.
* I am adding select-options value to an internal table
LOOP AT s_vbeln.
wa_vbeln-vbeln = s_vbeln-low.
APPEND wa_vbeln TO it_vbeln.
ENDLOOP.
Regards,
Ankur Parab -
How to disply internal table with grid format .
HI ,
how to disply internal table with grid format .
Regards
venkatGrid format can be disaplyed using two ways,
1. Using reuse_alv_grid_display
2. using object oriented ABAP with the methos set_table_for_first_display.
For example program search in where used list for standard SAP programs.
If this is not the answer then please explain your issue in detail
Thanks,
Rama Krishna -
How to modify DataBase Table with an internal Table
Hi, Friends.
I am coping Data from a Database table to an internal table after modifying data in the internal table I want to modify the db table according to the modification in the internal table. can some one help me out in this way, i am doing this modification in Table Control in Screen programing.
My Code is as follow.
MODULE zfsl_stinf_tc_init OUTPUT.
IF tc_copy IS INITIAL.
SELECT * INTO CORRESPONDING FIELDS OF TABLE it_zfsl_stinf FROM zfsl_stinf.
tc_copy = 'X'.
REFRESH CONTROL 'TC_FOR_ZFSL_STINF' FROM SCREEN '0001'.
ENDIF.
ENDMODULE. " zfsl_stinf_init OUTPUT
*& Module zfsl_stinf_tc_move OUTPUT
text
MODULE zfsl_stinf_tc_move OUTPUT.
MOVE-CORRESPONDING wa_it_zfsl_stinf TO zfsl_stinf.
ENDMODULE. " zfsl_stinf_tc_move OUTPUT
*& Module STATUS_0001 OUTPUT
text
MODULE status_0001 OUTPUT.
SET PF-STATUS 'ZFSL_SCREEN_1ONLY'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0001 OUTPUT
*& Module zfsl_stinf_tc_modify INPUT
text
MODULE zfsl_stinf_tc_modify INPUT.
MOVE-CORRESPONDING zfsl_stinf TO wa_it_zfsl_stinf.
MODIFY it_zfsl_stinf FROM wa_it_zfsl_stinf INDEX tc_for_zfsl_stinf-current_line.
_*"" here i have the modified internal table " it_zfsl_stinf "*_
ENDMODULE. " zfsl_stinf_tc_modify INPUT
Kind regards,
FaisalHi
Here you are modifying your dbtable in module pool programming
so better to use work area to modify the database table
example:
data: itab type table of zfsl_stinf .
data: wa_itab type itab.
select single * from zfsl_stinf INTO itab WHERE <condition>
(pass your values to wa_itab.)
modify zfsl_stinf from values of wa_itab.
Regards
Srinivasu -
How to fill internal table with no data in debugging mode
Hi all,
I modified one existing program.Now I want to test it.I am not given test data.So in the middle of my debugging, I found that one internal table with no data.My problem is how to fill that internal table with few records in that debugging mode just as we change contents in debugging mode.If I want to proceed further means that internal table must have some records.
Please I dont know how to create test data so I am trying to create values temporarily in debugging mode only.
Thanks,
BalajiHi,
In the debugging do the following..
Click the Table button..
Double click on the internal table name..
Then in the bottom of the screen you will get the buttons like CHANGE, INSERT, APPEND, DELETE..
Use the APPEND button to insert records to the internal table..
Thanks,
Naren -
How to convert internal table with dynamic fields to XML
Dear all,
I met a problem like the following:
The aim is to transform the following parameter to XML
IT_FIELD stores the dynamic filed name of the internal table,with these fields, the dynamic internal can be created by cl_abap_tabledescr=>create(it_field)
IT_VALUE stores the value of the internal table dynamically created with dynamic fields.
For example
IT_FIELD =>
line1: FIELD1
line2: FIELD2
line3: FIELD3,
three lines in this internal table.
dynamically created internal table structure FIELD1 FIELD2 FIELD3
And IT_VALUE=>
1 2 3 (First line)
11 22 33
two lines of data.
Do you have any idea about how to transform the IT_VALUE to XML here? And also the transformed XML to the IT_VALUE.( we may need remember IT_FIELD here for later XML to IT_VALUE.)
Hope I describe the problem clearly.
Any inputs will be appreciated.
Edited by: Max Tang on Jan 12, 2009 3:46 PM
Edited by: Max Tang on Jan 12, 2009 4:14 PMHi,
you need to implement a bit of coding for that.
With the 'do varying' statement abap provides a loop over those fields. Within this loop you can build up a new internal table with one entry for each period and amount.
kind regards
Siggi
PS: I am not very familiar with CO, but I guess there will be a standard extractor for that. -
How to Fill Internal Table with contents of Select-Option
Hi all:
There is a select-option s_matnr on the self-made screen. An internal table t_int is declared in the program. The requirement is that users makes selection with multiple material numbers. I want to put the values of s_matnr into internal table t_int directly. Would you please tell me how?
Thank you very much in advance.
Edited by: dongdong guo on Jun 13, 2008 3:40 AMHi,
Select option works like an internal table only.
For table selection you can use it directly using IN operator in where clause
eg : where matnr IN s_matnr.
Before that you may need to validate the content of the select-option. For that also you need to transfer the content to a new internal table.
u can loop at the select-option.
eq: loop at s_matnr.
if s_matnr-low = 'MAT1'.
condition.
endif.
endloop.
if you just want to check whether any single valid material number exist in your user screen, then u can use a select single option with s_matnr directly.
select single matnr from mara
where matnr in s_matnr.
select-option s_matnr behaves like an internal table with four fields.
sign, option, low, high. -
How to pass internal table with data in ABAP OO
Hi experts ,
Here is the problem...
I create a screen 100 and use the internal table to get data from database, and then press the button on screen 100 , it will call screen 200.
I use ABAP OO code in screen 200, and i want to keep the internal table with data that i get from the sceen 100 parts, but it seems that it just supports to create a new internal table and get data from database in ABAP OO. That means i need to create a new table to save the data in internal table ? Or there is any other solution something like exporting or memory id ...
ps . the internal table in screen 100 is declared in global area, the beginning of the code.
Please give me some advice, thanks a lot!
Regards ,
ClaireI have already know how to do, here is my code:
METHODS fill_tree importing itab2 like itab1.
CALL METHOD: me->fill_tree exporting itab2 = itab1.
In METHOD fill_tree,
declare
data: itab3 TYPE STANDARD TABLE OF itab,
itab3[] = itab1[].
It is useful to me, thanks a lot. -
select pernr dlart darbt subty
into (loan-pernr , loan-ln_type,loan-ln_amt, loan-subty)
from pa0045
where pernr = pernr-pernr
and subty in ('Y001' , 'Y011' , 'Y010' , 'Z001' , 'Z005' , 'Z006')
and begda < fisc_day.
APPEND loan.
ENDSELECT.
SELECT ZZTEL0144B ZZTEL0144B ZZTEL0147B ZZTEL0150B ZZTEL0153B ZZTEL0156B
into (wa-ZZTEL0144B,wa-ZZTEL0144B,wa-ZZTEL0147B,wa-ZZTEL0150B, wa-ZZTEL0153B, wa-ZZTEL0156B)
from pa9999
WHERE pernr = loan-pernr
and subty in ('Y001' , 'Y011' , 'Y010' , 'Z001' , 'Z005' , 'Z006')
and begda < fisc_day.
APPEND wa.
ENDSELECT.
in 1st Query i gett data related tothe PF loans . in 2nd query i got the data related to the balances and repayments. i have to apprend the 2nd query in internal table Loan. according to the respect records kindly help me out>> is it possible to define internal table with header line.
NO.. you have to create a work area & loop at the itab into this work area.. and you can modify the itab contents from this work area..
~Suresh -
How to populate smart form with new values
Hi!
I am new to smart form . Can anybody help me in how to populate smart form with some new fileds. Actually i have to populate credit memo form with some customized values..Hello,
Please elaborate your query more in order to be comprehendable.
Regards,
Shehryar -
How to replace namespace tag with new value using -JAVA MAPPING
Hi Guys,
I need to replace namespace Tag in Target xml with a new value.
For Eg: My namespace Tag is - <ns0:TestHeader xmlns:ns0="http://0020.TestHeader.SS.com">
I want My target xml to have value- <ns0:TestHeader>
How can i achieve it using JAVA mapping?
Can you provide me the code to do so.Sarjana,
Not well-formed XML is only possible by Java Mapping. Please use below replace logic in Java map.
inputContent.replaceAll("<ns0:TestHeader xmlns:ns0=\"http://0020.TestHeader.SS.com\">", "<ns0:TestHeader>");
Link1, Link2. -
Dynamically fill the internal table with new fileds
Hi Friends,
I have the internal table like
Data:begin of i_data occurs 0,
a(60),
b(60),
c(60),
d(60),
e(60),
end of i_data.
I need to fill the internal table dynamically like
Data:begin of i_data occurs 0,
a(60),
b(60),
c(60),
c1(60), "new filed dynamically
c2(60), "new field dynamically
d(60),
e(60),
end of i_data.
Please suggest me how to do this.
Regards,
Sunny.
Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 1:55 PMYou can not add new fields to a statically defined internal table, instead you must create the entrie internal table at runtime.
Search this forum for Dynamic Internal tables, you will get a lot of example programs.
Regards,
Rich Heilman -
VK12 - disappered %? how to transport the table with new tax codes?
Hallo
I'm changing conditions for tax codes in VK12. I have 2 questions:
1. When I created new entries, the % sign disappears. What shoud I do with this?
2. Should I create a transport with this changes? Or should I create all new entries with new tax codes manually in all target systems?
Thanks for all help,
Megyhi,
normally tax code changes will be done in PRD directly.
no need to transport
in VK12, that is change condtion record, you will find the details of condition record right.
then why are you going to create again.
change what ever you want to change then and there only and proceed with your requriment.
regards,
balajia -
How to create a table with distinct values ?
I want to create a new table based on an existing table distinct values only, how can I avoid to create the duplicate values ?
e.g.
table1
field1 field2
0001 ABD
0001 ABD
0002 DCF
0002 DCF
new table
field1 field2
0001 ABD
0002 DCF
thankscreate table table2
as
select distinct field1,field2
from table1
Maybe you are looking for
-
ITunes Says Original File Cannot Be Found...Over and Over!
How do I stop this from happening? I use an external HD, as it's an 88 GB collection and I don't want that on my iMac's primary HD/ Every couple of months, thousands of files are "lost", even though they're safe and sound in the iTunes Remote library
-
How to receive email in SAP SBWP or SO01 ?
Hi, I have no problem to configure SAP to send mail out. Now want to configure it to receive mail in SAP Inbox (SBWP/SO01) but not successful. Found the thread Receiving e-mails in SAP (from Exchange 2000) but information is limited. My system info a
-
New Windows Setup Can Be Synced To Only the Last Used Windows Installation?
Hello, I have found out that Windows allows you to synchronize only with the last used Windows installation and does not allow you to choose to which of your Windows installations you want to synchronize. Why is that? Here's my experience. 1. I insta
-
Attaching document to solution through programming
the problem is in crm there is transaction is01. it is transaction to maintain problems and solutions. where problems and solutions are objects of crm. the master tables for these are isol, isom. ok into this using bapi s i am uploading the data fro
-
Sequence Error in A/P Payment Function
I have the trouble in the payment function of Oracle Payables.error msg # is "APP-FND-01702". I guessed the problem is document category error. Though I used any payment method,error msg is the same. I want your reply as soon as possible. My e-mail a