Skip to Content
0
Former Member
Aug 03, 2006 at 05:15 AM

Problem in calling ABAP Subroutine from SAPSCRIPT

153 Views

Hi,

I need to get the reason for cancellation of a Business Even in Training & Event Management module, so I am passing Emp_id.

But the reason(CAAATRT) is returned with blank by the code.

please help.

/:DEFINE &EMP_ID&= &PPVAR-TOBJD&

/:PERFORM HR_REASON_PRINT IN PROGRAM ZHR_REASON_PRINT

/:USING &EMP_ID&

/:CHANGING &CAATRT&

REPORT ZHR_REASON_PRINT.

DATA : BEGIN OF in_par OCCURS 10.

INCLUDE STRUCTURE itcsy.

DATA : END OF in_par.

DATA : BEGIN OF out_par OCCURS 0.

INCLUDE STRUCTURE itcsy.

DATA : END OF out_par.

DATA: TOBJD TYPE PPVAR-TOBJD,

ADATANR TYPE HRP1001-ADATANR,

CAATR TYPE HRPAD25-CAATR,

CAATRT TYPE T77CART-CAATRT,

EMP_ID TYPE C.

TABLES : PPVAR,

HRP1001,

HRPAD25,

T77CART.

FORM HR_REASON_PRINT TABLES input output.

in_par[] = input[].

out_par[] = output[].

READ TABLE in_par INDEX 1.

  • CHECK sy-subrc = 0.

  • TOBJD = in_par-value.

MOVE in_par-value TO TOBJD.

SELECT ADATANR

into ADATANR

FROM HRP1001

WHERE OBJID EQ TOBJD.

ENDSELECT.

SELECT CAATR

into CAATR

FROM HRPAD25

WHERE ADATANR EQ ADATANR.

ENDSELECT.

SELECT CAATRT

INTO CAATRT

FROM T77CART

WHERE CAATR EQ CAATR.

ENDSELECT.

REFRESH out_par.

out_par-name = 'DREASON'.

move CAATRT To out_par-value.

MODIFY out_par INDEX 1.

  • APPEND out_par.

output[] = out_par[].

Thanks

Ramakrishna