Wednesday, March 18, 2020

Upload text file to internal table in SAP ABAP.



Upload text file to internal table in SAP ABAP.


Upload text file to internal table.

It was explained how to get all the file from the local system to fetch the text file to be uploaded. Well, This post is an example of using the function module to process text files that are uploaded into the internal table. The function used for uploading is GUI_UPLOAD.

To upload the flat text passing parameter file 'ASC', while the delimited tab use 'DAT'.

*&---------------------------------------------------------------------*
*&      Data Declaration
*&---------------------------------------------------------------------*
TABLES: rlgrap.

TYPES: BEGIN OF ty_item,
        ebeln LIKE ekpo-ebeln,
        ebelp LIKE ekpo-ebelp,
      END OF ty_item.

DATA: t_item TYPE STANDARD TABLE OF ty_item WITH HEADER LINE.

SELECT-OPTIONS: s_file FOR rlgrap-filename NO INTERVALS NO-EXTENSION.

*&---------------------------------------------------------------------*
*&      Events
*&---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_file-low.
  PERFORM f_help_for_file CHANGING s_file-low.

START-OF-SELECTION.
  PERFORM f_upload_data TABLES t_item.

  LOOP AT t_item.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = t_item-ebeln
      IMPORTING
        output = t_item-ebeln.
    MODIFY t_item.
  ENDLOOP.
*&---------------------------------------------------------------------*
*&      Form  f_help_for_file
*&---------------------------------------------------------------------*
FORM f_help_for_file  CHANGING s_file-low.

  CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
      static    = 'X'
    CHANGING
      file_name = s_file-low.

ENDFORM.                    " F_HELP_FOR_FILE

*&---------------------------------------------------------------------*
*&      Form  f_upload_data
*&---------------------------------------------------------------------*
FORM f_upload_data TABLES ft_table.
  DATA: ld_string TYPE string.

  ld_string = s_file-low.
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                = ld_string
      filetype                = 'ASC'
      has_field_separator     = ' '
    TABLES
      data_tab                = ft_table
    EXCEPTIONS
      file_open_error         = 1
      file_read_error         = 2
      no_batch                = 3
      gui_refuse_filetransfer = 4
      invalid_type            = 5
      no_authority            = 6
      unknown_error           = 7
      bad_data_format         = 8
      header_not_allowed      = 9
      separator_not_allowed   = 10
      header_too_long         = 11
      unknown_dp_error        = 12
      access_denied           = 13
      dp_out_of_memory        = 14
      disk_full               = 15
      dp_timeout              = 16
      OTHERS                  = 17.
  IF sy-subrc NE 0.
    WRITE: 'error', sy-subrc.
    STOP.
  ENDIF.

ENDFORM.                    " F_UPLOAD_DATA

Customer Exit and BAdI for PO in SAP

Customer Exit and BAdI for PO.

BAdI for PO.




The following is a list of customer Exits and BADI that I have used to date, along with their functions:

BADI ME_PURCHDOC_POSTED
Method: POSTED
TCode: ME22N, ME23N, ME29N

BADI ME_PROCESS_PO_CUST
Method: CLOSED
TCode: ME22N, ME23N, ME29N

Customer Exit MM06E005 (Customer fields in purchasing documents)
EXIT_SAPMM06E_016 (Export Data to Customer Subscreen for Purchasing Document Items (PBO))
desc: can be used to validate the header line or line item before
data storage process. so later validation checks will be made at the time
the user presses enter after inputting data on the subscreen.

Actually there are many more exits that can be used. I wrote only a few possible references.

Tuesday, March 17, 2020

SCC1 in SAP.


SCC1  Client Copy.
SCC1
T-Code: SCC1 this t-code use for supplement to the client copy. It can be used to meanly transfer individual transport request to directly out for the source client into the current client. This activities are listed in a clearly structured copy log. Example, you can start the report in test mode, which generates a log as in the production run but does not perform any database update. If the number or size of the tables is very large, you are recommended to start this report in the background process.

T-Code: SCC1 this is different from T-code: STMS because transaction code.SCC1 T-code is used to transport request from different client in the same system.


Tuesday, March 10, 2020

How to create QR code IN SAP ABAP.


QR Code create in SAP ABAP step by step.


QR Code create in step by step.

GO TO:T- CODE SE73
Create QR Code
























Create style for QR Code
GO To T-CODE:-Smartstyles
Create Style for QR Code



Declare QR code in smartforms

Go To T-CODE:- smartforms