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

Sapscript multiple customer data

Former Member
0 Likes
759

Hi all,

I am new to sapscript. I have done the program where i have taken 5 different windows.

1st window will show customer name

2nd window will show the posting date lik 19/10/2000 to 10/10/2010

3rd window will show address of the customer whose name is been printed in the 1st window

4th window will show the current date and page numbers

5th window is the main window where i am displaying few fields of the customer.

i am getting the output right for 1 customer.

But i want to know what i need to do if i vl b having a range of customers. I want to show all the fields in all the windows corresponding to the select-option range for the customer.

If any one can help me out.

6 REPLIES 6
Read only

Former Member
0 Likes
728

Hi Piyush,

I think you want to get output separetely for each customer than you have to include your whole logic of call to sap script in loop and passing each customar details at a time fro your driver program..i.e startform writeform and closeform logic..

if you want to print multiple customer details in the same form than just include writeform  logic in loop

in your driver program...

Regards,

Shashikanth

Read only

0 Likes
728

Hi,

2 options possible:

1. Create a warper that calls your programm for each customer -> bad performance but easy to develop.

2. change your programm logic, so you can get several customers in internal table and warp a loop around your forms. Its up to you if you do the new site with

command "new-line"

start/end-form

open/close form

regards

Stefan Seeburger

Read only

0 Likes
728

Hi Shashikath,

Be clear that only main window  can display all values.

For your requirement.

Sort your itab with customer.

inside a loop.

loop at itab.

at new of kunnr.

flag = 'X'.

endat.

if flag is not initial and sy-tabix NE '1'.

perform new page.

endif.

endloop.

form newpage.

CALL FUNCTION 'WRITE_FORM'
      EXPORTING
        ELEMENT                        = 'PAGE'
*       FUNCTION                      = 'SET'
*       TYPE                          = 'BODY'
*       WINDOW                        = 'MAIN'
*     IMPORTING
*       PENDING_LINES                 =
      EXCEPTIONS
        ELEMENT                        = 1
        FUNCTION                       = 2
        TYPE                           = 3
        UNOPENED                       = 4
        UNSTARTED                      = 5
        WINDOW                         = 6
        BAD_PAGEFORMAT_FOR_PRINT       = 7
        SPOOL_ERROR                    = 8
        CODEPAGE                       = 9
        OTHERS 

endform.


In SAP Script.


/E PAGE

/: NEW-PAGE





Regards,

Venkat.

Read only

Former Member
0 Likes
728

thank you so much everyone for ur immediate replies....n m sorry for reverting back so late...

Ur suggestions helped a lot achieving the final desired output.

Thank you so much...

Read only

Former Member
0 Likes
728

I am thinking of incorporate daily attendance system in my curriculum project.

So if anyone can guide me how to achieve that...

Customs table : Zemployee

Itz basically based on the restaurant employees where there will be 2 shifts in which the employees will be working.

I want to achieve list of 30 days of attendance if i input a date in the selection screen as a parameter.

Need last 30 days attendance from that day.

can anyone guide me??

Read only

0 Likes
728

Hi Piyush,

Hope I Understand,

Declare two variables,

Data: startdate  type d,

         enddate   type d.

Pass the date from the selection screen to FM HR_JP_MONTH_BEGIN_END_DATE to get the date intervals for the corresponding  month

ie start date and end date of the month.

In Select Query.

where date between start date and end date.

Regards,

Venkat.