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

SAP Script multiple items

Former Member
0 Likes
610

Hello.

I want to display multiple records in a window.(Not main window)

My code is below.

<SE38(ABAP Program for calling subroutines)>

CALL FUNCTION 'START_FORM'.

:

LOOP AT ITAB.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'ITEM'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'WINDOW1'

ENDLOOP.

:

CALL FUNCTION 'END_FORM'.

<SE71(PRINT PROGRAM)>(Window1)

DEFINE &BUKRS& = & REGUP-BUKRS&

DEFINE &VBLNR& = & REGUP-VBLNR&

DEFINE &XBLNR& = ' '

PERFORM SUB1 IN PROGRAM PG1

USING &BUKRS&

USING &VBLNR&

CHANGING &XBLNR&

ENDPERFORM

/E ITEM

AS &XBLNR&

I wrote this code by reference to other similar questions.

But it's not going well. Please help.

1 REPLY 1
Read only

SimoneMilesi
Active Contributor
0 Likes
515

Hi ryo-yama

You should tell us what it means "it's not going well".

The first thing I see it's that, in your Sapscript you want to display field XBLNR

Where do you fill it in your loop in your program?

LOOP AT ITAB.

"Which value has XBLNR in this point if you debug?
  CALL FUNCTION 'WRITE_FORM'
      EXPORTING  ELEMENT = 'ITEM'
                 FUNCTION = 'SET'
                 TYPE = 'BODY'
                 WINDOW = 'WINDOW1'.
ENDLOOP.

Debug your report and check:

  1. if you have global variable called XBLNR
  2. Which value it stores during the loop

A little suggestion for the future: use CODE option (pasting your code as plain text) to make it more easy to read and share as much as information you can.
If you say "it's not going well" is a bit unclear and we struggle into helping you 🙂