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

Write statement

madhu_reddy22
Participant
0 Likes
800

Hi All,

The w-pernr(personnel number) is not getting displayed when i use the statement below. i am only getting messages. What is my mistake.

LOOP AT itab_bapiret2_t

INTO wa_bapiret2_t where Type = ' E '.

WRITE 😕 w_pernr, wa_bapiret2-MESSAGE.

ENDLOOP.

Also i want the output to be displayed like this . How should i use the write statement

P Error Messages

-


1 xxxxxxxxxxxxx

-


2 xxxxxxxxxxxx

-


......

........

............

.........

Thanks in Advance

null

Message was edited by:

madhu reddy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
780

Hi Madhu,

I think you dont have any value in w_pernr, so this may cause not to print anything. Try to check whether there is any value for w_pernr in debugging.

For output format check this code.

<b>WRITE:/005 'P', 025 'Error Messages'.

ULINE.</b>

LOOP AT itab_bapiret2_t

INTO wa_bapiret2_t where Type = ' E '.

WRITE 😕 w_pernr, wa_bapiret2-MESSAGE.

<b>ULINE.</b>

ENDLOOP.

Thanks,

Vinay

7 REPLIES 7
Read only

Former Member
0 Likes
780

I don't think there is anything wrong, it is probably that you don't have any value in w_pernr. See where it is set and see if that is not correctly happening.

You can change your write statements by specifying position where you want the value to be written instead of writing them one next to the other.

Read only

Former Member
0 Likes
780

Looks like you are using BAPI FM,so there are no error messages

<b>wa_bapiret2_t where Type = ' E '.</b>,if you change type then you will get some values.

Thanks

Seshu

Read only

Former Member
0 Likes
781

Hi Madhu,

I think you dont have any value in w_pernr, so this may cause not to print anything. Try to check whether there is any value for w_pernr in debugging.

For output format check this code.

<b>WRITE:/005 'P', 025 'Error Messages'.

ULINE.</b>

LOOP AT itab_bapiret2_t

INTO wa_bapiret2_t where Type = ' E '.

WRITE 😕 w_pernr, wa_bapiret2-MESSAGE.

<b>ULINE.</b>

ENDLOOP.

Thanks,

Vinay

Read only

0 Likes
780

Hi , i am having the value in w_pernr. But anyways the code below is working for me.

WRITE: w_pernr.

LOOP AT itab_bapiret2_t

INTO wa_bapiret2_t where Type = ' E '.

WRITE : 025 wa_bapiret2-MESSAGE.

ENDLOOP.

ULINE.

I dont know why the value is not getting printed when i keep it in the loop.

Read only

0 Likes
780

Hi Madhu,

Code like below:

LOOP AT itab_bapiret2_t INTO wa_bapiret2_t where Type = ' E '.

WRITE 😕 w_pernr ,

wa_bapiret2-MESSAGE.

ULINE.

ENDLOOP.

Thanks and Best Regards,

Vikas Bittera.

**Points for useful answers**

Read only

Former Member
0 Likes
780

check if you are clearing the w_perner.. check the value of the perner before the loop.

Thanks

Mahesh

Read only

Former Member
0 Likes
780

Hi Madhu,

where from are you getting the value in w_pernr? Check the value before the loop statement.

Thanks and Best Regards,

Vikas Bittera.

**Points for useful answers**