Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Create simple program for starter

Garcia
Product and Topic Expert
Product and Topic Expert
0 Likes
576

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
542

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

4 REPLIES 4
Read only

Former Member
0 Likes
543

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

Read only

Former Member
0 Likes
542

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

Read only

Former Member
0 Likes
542

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

Read only

Garcia
Product and Topic Expert
Product and Topic Expert
0 Likes
542

Thank you!