Skip to Content
author's profile photo Former Member
Former Member

pass work area to subroutine.

i have to pass wa_msg TYPE bal_s_msg to a subroutine Add_message.

perform Add_message using wa_msg.

form Add_message using lwa_msg type bal_s_msg .

will values of wa_msg will pass.

plz reply

Add comment
10|10000 characters needed characters exceeded

4 Answers

  • Best Answer
    Posted on Aug 02, 2006 at 04:56 PM

    Of course.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 04:58 PM

    you can use USING or CHANGING in the form definition.

    <b>form Add_message using p_wa type bal_s_msg .</b>

    you can use P_WA in this form.

    endform.

    regards

    srikanth

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 05:01 PM

    Hi,

    I would suggest you to go through the below link,

    http://help.sap.com/saphelp_47x200/helpdata/en/9f/db984635c111d1829f0000e829fbfe/content.htm

    Regards,

    Azaz Ali.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 07:17 PM

    Hi ,

    Just Try this code(copy & paste)

    PERFORM LOG_CREATE.
    PERFORM ADD_MESSAGE USING WA_MESSAGE.
    FORM LOG_CREATE.
    
      DATA: WL_LOG  TYPE BAL_S_LOG.      "Log header
    
    * Delete the old log handle if already created
      IF NOT W_LOG_HANDLE IS INITIAL.
        CALL FUNCTION 'BAL_LOG_DELETE'
             EXPORTING
                  I_LOG_HANDLE  = W_LOG_HANDLE
             EXCEPTIONS
                  LOG_NOT_FOUND = 0
                  OTHERS        = 0.
        IF SY-SUBRC <> 0.
        ENDIF.
      ENDIF.
    
    
    * Create log and get handle
      CALL FUNCTION 'BAL_LOG_CREATE'
           EXPORTING
                I_S_LOG      = WL_LOG
           IMPORTING
                E_LOG_HANDLE = W_LOG_HANDLE
           EXCEPTIONS
                OTHERS       = 2.
      IF SY-SUBRC <> 0.
      ENDIF.
    
    ENDFORM.                    " LOG_CREATE
    
    FORM ADD_MESSAGE USING PWA_MESSAGE type BAL_S_MSG.
    
      CALL FUNCTION 'BAL_LOG_MSG_ADD'
           EXPORTING
                i_log_handle        = W_log_handle
                i_s_msg             = PWA_MESSAGE.
    
    ENDFORM.
    
    

    Regards,

    Raghav

    Add comment
    10|10000 characters needed characters exceeded