‎2008 Jul 09 8:08 PM
Hello,
I'm a functional consultant and I want to create a program.
Here's the deal: I know basic code functions (select, where, if's...), break and debbug But nothing else.
My client doesn´t want to install LSMW on the server, and the deal is pretty simple so I guess with your help it will be easy.
DATA: field A links table 1 and 2. Field B is from table 1. Field C is from table 2 and can be loaded with field B (field C is blank so far).
My program needs to:
If field A in table 2 has an entry in table B, field C (for that line) should take the value of field B.
Can you help up on this? I know it's pretty simple... Do I start in SE38?
Regards.
‎2008 Jul 09 8:15 PM
yes,
u can start writing code in se38.
select fieldA from table 1 into table itab
where <condition>
select field b, c from table 2 into table jtab
for all entries in itab
where fieldA = itab-fieldA
loop on jtab.
read itab..
append final table.
endloop.
or
select afieldA bfieldB b~fieldC from ( table 1 as a inner join table 2 as b
on afiledA = bfieldB )
into table itab
where <condition>
loop on itab.
write 😕 your fields.
endloop.
This is rough program, u can start working like this.
all the best
‎2008 Jul 09 8:15 PM
yes,
u can start writing code in se38.
select fieldA from table 1 into table itab
where <condition>
select field b, c from table 2 into table jtab
for all entries in itab
where fieldA = itab-fieldA
loop on jtab.
read itab..
append final table.
endloop.
or
select afieldA bfieldB b~fieldC from ( table 1 as a inner join table 2 as b
on afiledA = bfieldB )
into table itab
where <condition>
loop on itab.
write 😕 your fields.
endloop.
This is rough program, u can start working like this.
all the best
‎2008 Jul 09 8:22 PM
Hello,
There are lot of demo programs provided by SAP.
You can start with the 'Hello World' program DEMO_HELLO_WORLD in se38.
hope this helps.
cheers,
Sushil Joshi
‎2008 Jul 09 8:28 PM
Hello Gonçalo Garcia ,
This can be achieved using select statement with innerjoin as follows:
select single TABLE-1~FIELD-B
into FIELD-C
from TABLE1 as TABLE-1
INNER JOIN TABLE1-FIELD-B = TABLE2-FIELD_ON-TABLEB
where .
Above select is an example for your situation.
Thanks,
Greetson
‎2008 Jul 12 3:54 PM