‎2010 Aug 24 1:00 PM
i am checking one codition. if that condition satisfies, to give a message i have to fill the return parameter.
For this i have used the function module BALW_BAPIRETURN_GET2 and in this RETURN parameter is of structure BAPIRET2.
But my requirement is, i want a function module to give messagewhich uses RETURN parameter of type BAPIRETURN1.
could you please help me if u have any idea.
‎2010 Aug 24 1:36 PM
‎2010 Aug 24 1:36 PM
Hi,
You question is not clear Is you function module custom one ?
Explain it more clearly.
‎2010 Aug 25 8:07 AM
Hi Keshav,
yes, its a custom function module..
i am sending the code
FUNCTION zbapi_hr_record_time.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(EMPNO) LIKE ZBAPIP9090-EMPNO
*" VALUE(EDATE) LIKE ZBAPIP9090-EDATE
*" VALUE(NO_OF_HOURS) LIKE ZBAPIP9090-NO_OF_HOURS
*" VALUE(COMMENTS) LIKE ZBAPIP9090-COMMENTS
*" VALUE(EENDDA) LIKE ZBAPIP9090-EENDDA DEFAULT SY-DATUM
*" VALUE(EBEGDA) LIKE ZBAPIP9090-EBEGDA DEFAULT SY-DATUM
*" EXPORTING
*" VALUE(RETURN) LIKE BAPIRET2
*"----------------------------------------------------------------------
DATA : p9090 LIKE p9090,
opern LIKE psyst-ioper VALUE 'INS'.
DATA : it_pa9090 LIKE pa9090 OCCURS 0 WITH HEADER LINE,
wa_hours(2) TYPE c.
SELECT no_of_hours FROM pa9090
INTO CORRESPONDING FIELDS OF TABLE it_pa9090
WHERE empno = empno
AND edate = edate.
CLEAR wa_hours.
LOOP AT it_pa9090.
wa_hours = wa_hours + it_pa9090-no_of_hours.
ENDLOOP.
wa_hours = wa_hours + no_of_hours.
IF wa_hours GT 24.
*CALL FUNCTION 'BALW_BAPIRETURN_GET2'
* EXPORTING
* type = 'E'
* cl = 'ZHR_TIME'
* number = '000'
** PAR1 = ' '
** PAR2 = ' '
** PAR3 = ' '
** PAR4 = ' '
** LOG_NO = ' '
** LOG_MSG_NO = ' '
** PARAMETER = ' '
** ROW = 0
** FIELD = ' '
* IMPORTING
* return = return
* .
ELSE.
****************************************
ENDIF.
ENDFUNCTION.in the aboove code, after IF condition (IF wa_hours GT 24.) instead of using BALW_BAPIRETURN_GET2 function module i want an alternative function module to return message. here in BALW_BAPIRETURN_GET2, RETURN is declared as BAPIRET2, but i want it as of BAPIRETURN1 structure. so could you please tell me if u know any other FM to RETURN message which uses BAPIRETURN1 structure.
‎2010 Aug 24 1:36 PM
‎2010 Aug 25 8:08 AM
Hi Senthil
the FM u sent uses BAPIRET1structure, but i want BAPIRETURN1.
‎2010 Aug 25 8:18 AM
THANK YOU...
BAPIRET1 and BAPIRETURN1 Both are having same sturctures.
so i have used BAPIRET1.
‎2010 Aug 25 8:35 AM
Hi,
you can achieve this in two ways as shown below. Both will give same result.
CALL FUNCTION 'BALW_BAPIRETURN_GET1'
EXPORTING
type = 'E'
cl = 'ME'
number = '023'
PAR1 = '100256'
PAR2 = '001'
* PAR3 = ' '
* PAR4 = ' '
* LOG_NO = ' '
* LOG_MSG_NO = ' '
IMPORTING
BAPIRETURN = e_return..
MOVE 'E' TO e_return-type.
MOVE 'ME' TO e_return-id.
MOVE '023' TO e_return-number.
MOVE '100256' TO e_return-MESSAGE_V1.
MOVE '001' TO e_return-MESSAGE_V2.
MESSAGE ID 'ME' TYPE 'E' NUMBER '023' WITH '100256' '001' INTO e_return-message.