cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Script subroutine and diplay

Former Member
0 Kudos

523

- Heading for open item list of line items -


&ULINE(71)&

<K>Invoice No,,Reference.,,Inv.Date,, Due date,,,,

Balance</>

,,,,,,

&ULINE(71)&

PERFORM GET_DATE IN PROGRAM ZREPORT

USING &BSID-BELNR&

CHANGING &S_DATE&

ENDPERFORM.

530

- Line items Customer open items -


&BSID-BELNR&,,&RF140-BELEGNUM&,,&BSID-BLDAT&,,&S_DATE&,,

&RF140-WRSHB&

-


Created a new report with the below code..

REPORT ZREPORT.

&----


*& Form get_date1

&----


  • text

----


  • -->S_ITAB text

  • -->S_ITAB1 text

----


FORM get_date using s_itab

changing s_itab1.

*FORM get_date1tables int_cond structure itcsy

*outt_cond structure itcsy.

data : s_itab11(10) type c value '01/01/2006'.

  • s_itab11 eq sy-datum.

s_itab1 = s_itab11.

ENDFORM.

If I am printin out the columns under s_date is blank..instead I want to default it as '01/01/2006'.

is it some thing which I need to take care..?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try making s_itab1 a global variable.

Rob

Former Member
0 Kudos

How should I make it global and how would that help passing the date value

Former Member
0 Kudos

Try this:

REPORT zreport.

DATA: s_date TYPE dats.

*&---------------------------------------------------------------------*
*&      Form  get_date
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM get_date.

  s_date = sy-datum.

ENDFORM.                    "get_date

And remove the using and changing from the SAPScript.

Rob

Answers (1)

Answers (1)

Former Member
0 Kudos

if s_date is blank and in that case you want to default it some date you can do this with a simple if-endif statement as follows:

530

if &s_date& is initial.

s_date = 01/01/2008

endif.

- Line items Customer open items -


&BSID-BELNR&,,&RF140-BELEGNUM&,,&BSID-BLDAT&,,&S_DATE&,,

&RF140-WRSHB&

cheers,

Sushil Joshi

Former Member
0 Kudos

Hi Sunil,

I want to get it from subroutine and check.

later I would like to add the logic in the subroutine.

right now I want the date from subroutine.(Zreport)

naimesh_patel
Active Contributor
0 Kudos

You have to make couple of changes to your subroutine:


FORM get_date tables int_cond structure itcsy
outt_cond structure itcsy. 

READ TABLE INT_COND WITH KEY NAME = 'BSID-BELNR'
W_BELNR = INT_COND-VALUE.
 
* Use W_BELNR for further processing

data : s_itab11(10) type c value '01/01/2006'.

READ TABLE OUTT_COND WITH KEY name = 'S_DATE'.
  IF sy-subrc = 0.
    outt_cond-value = S_itab11.
    MODIFY outt_cond INDEX sy-tabix.
  ENDIF.

ENDFORM. 

Regards,

Naimesh Patel