Monday, August 31, 2020

Event in ABAP report in SAP

ABAP Programming EVENTS in SAP.

https://sapabap100.blogspot.com/2020/08/event-in-abap-report-in-sap.html


Below are some of the events avalable within ABAP programming. 

1.LOAD-OF-PROGRAM
2.INITIALIZATION
3.AT SELECTION SCREEN OUTPUT

LOOP AT SCREEN.
  IF SCREEN-name = 'P_FIELd1'.
    SCREEN-INTENSIFIED = '1'.
    MODIFY SCREEN.
    CONTINUE.
  ENDIF.
ENDLOOP.

4.AT SELECTION-SCREEN.

5.AT SELECTION-SCREEN ON
<parameter1>
AT SELECTION-SCREEN ON Block <block1>
AT SELECTION-SCREEN ON HELP-REQUEST for <parameter1> (i.e. When press F1)
AT SELECTION-SCREEN ON VALUE-REQUEST for <parameter1> (i.e. When press F4)
AT SELECTION-SCREEN ON RADIOBUTTON for <parameter1> (i.e. When press F4)

AT SELECTION-SCREEN ON P_FIELD1.
AT SELECTION-SCREEN ON help-request for P_FIELD1.

6.TOP-OF-PAGE
7.TOP-OF-PAGE During LINE_SELECTION
8.END-OF-PAGE
ORT demo_rep NO STANDARD PAGE HEADING

                            LINE-COUNT 0(1). 

9.START-OF-SELECTION
10.END-OF-SELECTION
   

Friday, August 28, 2020

VOFM Routine Create in SAP

 VOFM Routine Create in SAP step by step.





   Go to ->VOFM T-Code

A. Once the Menu Select as per your requirements 
B. After that you Enter any Number in between 600 to 999 this is for  Custom Developments.
C. When you  entering Pop Screen appears ask for Access Key(We have to remember that Every New Routine needs an Access Key)


D. Once the Access Key is get you can do modification.
E. After that enter the routine number ,description and insert the Access Key
F. Next new  ABAP Editor will open and required code can be copied from Standard SAP Routine and Custom Code Can be developed.
G. Next the coding is completed you  have to Activate the Routine
H. Select the Routine and Go to Edit – Activate
I. Ensure that Active check box is ticked upon Activation of the Routine.
J. Double click on the routine will enter into ABAP Editor, You  have to generate the Routine
K. Go to Program and select Generate
L.A screen pops up with the related Main Programs  and select all required main programs wherever the Routine is being called.
M. Next the Routine is Generated and Activated, You need to configure the Routine in the config.

Batch Validation COR1 in PP Module In SAP

Enhancement COR1 for Batch Validation In SAP  PP Module.



Include Name: ZXCO1U06 COR1 for Batch Validation.


IF sy-tcode =  'COR1' OR sy-tcode =  'COR2' ).
  IF header_imp-auart 'ZA02' OR header_imp-auart 'ZU02'
  OR header_imp-auart 'ZA01' OR header_imp-auart 'ZA03'
  OR header_imp-auart 'ZU01' OR header_imp-auart 'ZU10'.
*************************
    FIELD-SYMBOLS <fs_afpo1> TYPE any.
*************************
    DATA ls_afpo1 TYPE afpod.
    TYPESBEGIN OF ty_mch11,
              matnr TYPE matnr,     "Material
              charg TYPE charg_d,   "Batch No
              lvorm TYPE lvoc1,
              ersda TYPE ersda,     "Date
              END OF ty_mch11.
    TYPESBEGIN OF ty_batch11,
            charg TYPE charg_d,
            atwtb TYPE ersda,
            END OF ty_batch11.
    DATA wa_mch11 TYPE ty_mch11,
           wa_mch21 TYPE ty_mch11,
           i_mch11 TYPE STANDARD TABLE OF ty_mch11.
    DATAv_mcha1 TYPE mcha,
          class1 TYPE klah-class,
          w_batch2 TYPE clbatch,
          i_batch2 TYPE STANDARD TABLE OF clbatch,
          w_batch11 TYPE ty_batch11,
          i_batch11 TYPE STANDARD TABLE OF ty_batch11.
    DATAv_date1 TYPE sy-datum.
    DATArec1 TYPE i.
    DATAv_count1 TYPE i.   " counter for loop
    ASSIGN ('(SAPLCOKO)AFPOD'TO <fs_afpo1>.
    ls_afpo1 <fs_afpo1>.
    SELECT matnr
           charg
           lvorm
           ersda
           
           charg
           lvorm
           ersda
           FROM mch1 INTO TABLE i_mch11
           
           WHERE matnr header_imp-plnbez.
    DATA:lv_lvorm1 TYPE lvoc1.
    CLEAR:lv_lvorm1.
    SELECT SINGLE matnr
                  charg
                  lvorm
                  ersda
                  
                  charg
                  lvorm
                  ersda
                  FROM mch1 INTO wa_mch21
                  
                  WHERE matnr header_imp-plnbez
                    
                    AND charg ls_afpo1-charg.
    IF wa_mch21-lvorm 'X'.
      MESSAGE  e005(zbtch_msgWITH ls_afpo1-charg header_imp-plnbez.
    ENDIF.
  ENDIF.
ENDIF.