0


Posting more than 19 serial number in BDC . BDC Scroll Down method

While creating a BDC program to update the serial numbers in VL01N, Serial Number profile will take only 19 Serial numbers, because of background screen limitation.

In order to pass additional serial numbers we have to scroll down the screen and pass the value. Below code will help to overcome this issue.


Step 1:
Create recording using t-Code SHDB

Step 2:
Change code according to your requirement

Step 3:
Write code for serial number less than or equal 19

MOVE TO IDX.
  
LOOP AT ITAB INTO WA.

    
IF SY-TABIX LE 19.

      
CONCATENATE 'RIPW0-SERNR (' IDX ')' INTO FNAM.
      
PERFORM BDC_FIELD       USING FNAM"'RIPW0-SERNR(01)'.
                                   
     
      IDX 
IDX + 1.
    
ENDIF.

  
ENDLOOP.

Step 4 :
Write Code for Serial Number Greater than or equal 19

IF LFIMG GE 19.
    
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    
'=PNPG'.
    
PERFORM BDC_DYNPRO      USING 'SAPLIPW1' '0200'.
    
PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  
'RIPW0-SERNR(19)'.
    
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                  
'=AMAR'.
    
MOVE 02 TO IDX1.
    
LOOP AT ITAB INTO WA.
      
CLEAR IT.
      
READ TABLE IT WITH KEY.
      
IF SY-SUBRC NE 0.
        
CONCATENATE 'RIPW0-SERNR (' IDX1 ')' INTO FNAM.
        
PERFORM BDC_FIELD       USING FNAM"'RIPW0-SERNR(01)'.
        IDX1 
IDX1 + 1.
      
ENDIF.
    
ENDLOOP.

  
ENDIF.

Step 5:
Write Code for Serial Number Greater than 19

IDX2 LFIMG.
  
CONDENSE IDX2.
  
IF G_LFIMG_01_010 GT 19.
    
PERFORM BDC_DYNPRO      USING 'SAPLIPW1' '0200'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                  
'RIPW0-SERNR(19)'.
  
ENDIF.

  
IF G_LFIMG_01_010 LE 19.
    
PERFORM BDC_DYNPRO      USING 'SAPLIPW1' '0200'.
    
CONCATENATE 'RIPW0-SERNR(' IDX2 ')' INTO FNAM.
    
PERFORM BDC_FIELD       USING 'BDC_CURSOR'"'RIPW0-SERNR(01)'
                                  FNAM
.                     "'bgl17'.
  
ENDIF.
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                
'=AMAR'.
 PERFORM BDC_DYNPRO      USING 'SAPLIPW1' '0200'.          "23.05
  
PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                
'RIPW0-SERNR(01)'.
  
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                
'=RWS'.
  
PERFORM BDC_DYNPRO      USING 'SAPMV50A' '1000'.
  
PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                
'=WABU_T'.
  
PERFORM BDC_FIELD       USING 'LIKP-BLDAT'
                                BLDAT_045
.
PERFORM BDC_TRANSACTION TABLES MESSTAB   USING  'VL01N' CTU
                                
MODE
                                
UPDATE.


Article By 
Mohammed Khalid Khan
ABAP Consultant

Post a Comment

 
Top