2019年11月15日星期五

Export License

Function:RV_EXPORT_CONTROL
Enhancement

Tr-code VX01n,VX22n

Customize: VE53,VE57,VE58
VE51:Legal control:License Types
VE52:Legal control:Departure country/Legal regulations 
VE53:Legal control:Control situation of Dest.country
VE57:Legal control:Country Classification by Destination Country
VE58:Legal control:Product Classification by Destination Country
VE60:Legal control:Export control classes
VE61:Legal control:Grouping Materials
VE62:Legal control:Export ontrol class / Grouping
   

Log display


https://answers.sap.com/questions/1515224/how-we-can-see-application-log.html

sap sample program:SBAL_DEMO_04


CALL FUNCTION 'BAL_DSP_PROFILE_POPUP_GET'
      IMPORTING
        E_S_DISPLAY_PROFILE V_PROFILE
      EXCEPTIONS
        OTHERS              1.

 V_PROFILE-USE_GRID   'X'.     "Use grid control for output
 V_PROFILE-POP_ADJST  'X'.     "Adjust popup height
 V_PROFILE-CWIDTH_OPT 'X'.     "Optimize message list column width
 V_PROFILE-TITLE      TEXT-M01.
 V_PROFILE-END_COL    110. 

 LOOP AT V_PROFILE-MESS_FCAT ASSIGNING <LV_MESS_FCAT>
                                   WHERE REF_FIELD 'MSGTY'
                                      OR REF_FIELD 'MSGID'
                                      OR REF_FIELD 'MSGNO'.

    LV_CNT LV_CNT + 1.
    CLEAR:<LV_MESS_FCAT>-NO_OUT.
    <LV_MESS_FCAT>-COL_POS LV_CNT.

  ENDLOOP.

* Application Log: Log: Create with Header Data
  CALL FUNCTION 'BAL_LOG_CREATE'
    EXPORTING
      I_S_LOG                 V_LOG
    IMPORTING
      E_LOG_HANDLE            V_LOG_HANDLE
    EXCEPTIONS
      LOG_HEADER_INCONSISTENT 1
      OTHERS                  2.
 APPEND V_LOG_HANDLE TO I_LOG_HANDLE.


  LOOP AT I_ERRPARAM INTO WA_ERRPARAM.

    CALL FUNCTION 'BAL_LOG_MSG_ADD'
      EXPORTING
        I_LOG_HANDLE     V_LOG_HANDLE
        I_S_MSG          WA_ERRPARAM
      IMPORTING
        E_S_MSG_HANDLE   V_MSG_HANDLE
      EXCEPTIONS
        LOG_NOT_FOUND    1
        MSG_INCONSISTENT 2
        LOG_IS_FULL      3
        OTHERS           4.

    IF SY-SUBRC <> 0.
*     Create Application Log
      PERFORM SYSTEM_ERROR USING 'BAL_LOG_MSG_ADD'
                                  SY-SUBRC.

    ENDIF.
  ENDLOOP.

 CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'
    EXPORTING
      I_T_LOG_HANDLE       I_LOG_HANDLE
      I_S_DISPLAY_PROFILE  V_PROFILE
      I_AMODAL             V_IM_NEW_SESSION
    IMPORTING
      E_S_EXIT_COMMAND     ST_EX_EXIT_COMMAND
    EXCEPTIONS
      PROFILE_INCONSISTENT 1
      INTERNAL_ERROR       2
      NO_DATA_AVAILABLE    3
      NO_AUTHORITY         4.

2019年11月12日星期二

Billing Consolidation (Multi Sales Order one billing)

Tr-code:VTFA

Chose Target and Source, For example: Target G2 and Source is CR

Header: Reference number  (A:Purchase Order number, B:Sales Order number...)

Item: Data VBRK/VBRP (For example 904.)


You can change consolidation conditions in Source below:

Include: RV60AFZC
Exit:   USEREXIT_FILL_VBRK_VBRP
change  the value of VBRK-XBLNR  and VBRK-BSTNK_VF.

   IF *TVCPF-XBLNR_FI 'A'.
       VBRK-XBLNR    VBAK-BSTNK.
       VBRK-BSTNK_VF VBAK-BSTNK.
    ENDIF.


Include: RV60C904
FORM DATEN_KOPIEREN_904.
" change value of vbrk-zukri  
ENDFORM.

           

Customer Characteristic

  Characteristic Descriptions are stored in the table - CABNT - Language - SPRAS - Characteristic description - ATBEZ Characteristic Values ...