Application Development 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: 

Structure

Former Member
0 Kudos

Hi,

I want to enter these details by a program, plz let me know how to do.

This is what i wrote.

DATA:

ST_EMP-EMPID = 1000.

ST_EMP-ENAME = RAJESH.

ST_EMP-SALARY = 10000.

WRITE:/ ST_EMP-EMPID,ST_EMP-ENAME,ST_EMP-SALARY..

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try with this program:

PARAMETERS: P_EID(8) TYPE N,

P_ENAME(20) TYPE C,

P_ESAL(8) TYPE N.

DATA: BEGIN OF ITAB OCCURS 0,

EMPID(8) TYPE N,

EMPNAME(20) TYPE C,

EMPSAL(8) TYPE N,

END OF ITAB.

ITAB-EMPID = P_EID.

ITAB-EMPNAME = P_ENAME.

ITAB-EMPSAL = P_ESAL.

APPEND ITAB.

LOOP AT ITAB.

WRITE: ITAB-EMPID, ITAB-EMPNAME, ITAB-EMPSAL.

ENDLOOP.

Regards,

Bhaskar

7 REPLIES 7

Former Member
0 Kudos

Hi Ram,

Define these fields using PARAMETERS so that they will come on selection screen.

Regards,

Atish

0 Kudos

hI,

I TRIED TO DEFINE IT USING Parameters, but still it giving message that

Unable to interpret "=". Possible causes of error: Incorrect spelling

0 Kudos

Hi,

there you should not define =.

Just do F1 on PARAMETERS and you will get the syntax, how to ue PARAMETERS.

Regards,

Atish

Former Member
0 Kudos

Hi,

RAJESH should be in quotes.

'RAJESH'.

Reward if useful!

Former Member
0 Kudos

Hi Ram,

try this out,

Parameters: p_empid(4) type n value 1000,

p_ename(10) type c value 'RAJESH',

p_salary type f decimals 2 value 10000.

<b>Reward points if this helps,</b>

Kiran

Former Member
0 Kudos

parameters:

P_EMPID LIKE ST_EMP-EMPID DEFAULT 1000,

P_ENAME LIKE ST_EMP-ENAME DEFAULT 'RAJESH',

P_SALARY LIKE ST_EMP-SALARY DEFAULT 10000.

default values will appear on selection screen where u can change them.

WRITE:/ P_EMPID, P_ENAME, P_SALARY.

reward if useful..

Former Member
0 Kudos

Hi,

Try with this program:

PARAMETERS: P_EID(8) TYPE N,

P_ENAME(20) TYPE C,

P_ESAL(8) TYPE N.

DATA: BEGIN OF ITAB OCCURS 0,

EMPID(8) TYPE N,

EMPNAME(20) TYPE C,

EMPSAL(8) TYPE N,

END OF ITAB.

ITAB-EMPID = P_EID.

ITAB-EMPNAME = P_ENAME.

ITAB-EMPSAL = P_ESAL.

APPEND ITAB.

LOOP AT ITAB.

WRITE: ITAB-EMPID, ITAB-EMPNAME, ITAB-EMPSAL.

ENDLOOP.

Regards,

Bhaskar