*&---------------------------------------------------------------------*
*& Report Z_SF_PDF
*&---------------------------------------------------------------------*
*& + This program demonstrates how easy it is to convert Smartforms to
*& and save as local file
*& + This example also demostrates how to skip the PRINT PREVIEW screen
*& where we give the default printer name. The name is set in the program.
*&
*& NOTE: The smartform called here is an example with no relation to the
*& standard forms. You will have to do the Smartform data population
*& befoer you use the code for PDF Conversion. Data can be sent to the
*& smartform through the Function Module G_FM_NAME's EXPORTING or
*& TABLES section
*&---------------------------------------------------------------------*
*& Written by:
*& URL: http://allaboutsap.blogspot.com
*&---------------------------------------------------------------------*
REPORT Z_SF_PDF.
*--- Internal tables, Structures and Variables used for PDF conversion
DATA: IT_OTF TYPE STANDARD TABLE OF ITCOO,
IT_DOCS TYPE STANDARD TABLE OF DOCS,
IT_LINES TYPE STANDARD TABLE OF TLINE,
ST_JOB_OUTPUT_INFO TYPE SSFCRESCL,
ST_DOCUMENT_OUTPUT_INFO TYPE SSFCRESPD,
ST_JOB_OUTPUT_OPTIONS TYPE SSFCRESOP,
ST_OUTPUT_OPTIONS TYPE SSFCOMPOP,
ST_CONTROL_PARAMETERS TYPE SSFCTRLOP,
V_LEN_IN TYPE SO_OBJ_LEN,
V_LANGUAGE TYPE SFLANGU VALUE 'E',
V_E_DEVTYPE TYPE RSPOPTYPE,
V_BIN_FILESIZE TYPE I,
V_NAME TYPE STRING,
V_PATH TYPE STRING,
V_FULLPATH TYPE STRING,
V_FILTER TYPE STRING,
V_UACT TYPE I,
V_GUIOBJ TYPE REF TO CL_GUI_FRONTEND_SERVICES,
V_FILENAME TYPE STRING.
*--- Perform to download the smartform as PDF
*--- This can be placed after the Form data population routines
PERFORM DL_SMARTFORM.
*&---------------------------------------------------------------------*
*& Form DL_SMARTFORM
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text *----------------------------------------------------------------------*
FORM DL_SMARTFORM .
*--- Data Declarations
data: C_FORMNAME TYPE TDSFNAME.
DATA: G_FM_NAME TYPE RS38L_FNAM.
c_formname = 'Z_SF2PDF_EXMPL'.
*--- To get output device type
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
I_LANGUAGE = V_LANGUAGE
I_APPLICATION = 'SAPDEFAULT'
IMPORTING
E_DEVTYPE = V_E_DEVTYPE.
ST_OUTPUT_OPTIONS-TDPRINTER = V_E_DEVTYPE.
ST_CONTROL_PARAMETERS-NO_DIALOG = 'X'.
ST_CONTROL_PARAMETERS-GETOTF = 'X'.
*--- Call Function to get the Function Module name for the smart form
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = C_FORMNAME
IMPORTING
FM_NAME = G_FM_NAME.
IF SY-SUBRC <> 0.
*--- Check for Errors
ENDIF.
*--- Call Smartform function module without hard coding
CALL FUNCTION G_FM_NAME
EXPORTING
CONTROL_PARAMETERS = ST_CONTROL_PARAMETERS
OUTPUT_OPTIONS = ST_OUTPUT_OPTIONS
* USER_SETTINGS = 'X'
* ADD YOUR DATA STRUCTURES HERE
IMPORTING
DOCUMENT_OUTPUT_INFO = ST_DOCUMENT_OUTPUT_INFO
JOB_OUTPUT_INFO = ST_JOB_OUTPUT_INFO
JOB_OUTPUT_OPTIONS = ST_JOB_OUTPUT_OPTIONS
* TABLES
* ADD YOUR DATA TABLES
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
.
IF SY-SUBRC <> 0.
*--- On Failure display standard Message
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
else.
*--- Convert OTF to PDF
CALL FUNCTION 'CONVERT_OTF_2_PDF'
IMPORTING
BIN_FILESIZE = V_BIN_FILESIZE
TABLES
OTF = ST_JOB_OUTPUT_INFO-OTFDATA
DOCTAB_ARCHIVE = IT_DOCS
LINES = IT_LINES
EXCEPTIONS
ERR_CONV_NOT_POSSIBLE = 1
ERR_OTF_MC_NOENDMARKER = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*--- Get filename to store
CONCATENATE 'Converted_Smartform' '.pdf' INTO V_NAME.
CREATE OBJECT V_GUIOBJ.
CALL METHOD V_GUIOBJ->FILE_SAVE_DIALOG
EXPORTING
DEFAULT_EXTENSION = 'pdf'
DEFAULT_FILE_NAME = V_NAME
FILE_FILTER = V_FILTER
CHANGING
FILENAME = V_NAME
PATH = V_PATH
FULLPATH = V_FULLPATH
USER_ACTION = V_UACT.
IF V_UACT = V_GUIOBJ->ACTION_CANCEL.
EXIT.
ENDIF.
*--- Download PDF to local PC
MOVE V_FULLPATH TO V_FILENAME.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = V_BIN_FILESIZE
FILENAME = V_FILENAME
FILETYPE = 'BIN'
TABLES
DATA_TAB = IT_LINES
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM. " DL_SMARTFORM
Monday, October 29, 2007
Web browser on SAP GUI
*&---------------------------------------------------------------------*
*& Report Z_BROWSERDEMO
*&---------------------------------------------------------------------*
*& This program demonstrates how to add a custom controller to a screen
*& that acts like a nomal web browser. In order to run the program,
*& The following elements are required:
*& + Create SCREEN 100
*& + Create an I/O fieeld with name "EDURL"
*& + Create a custom control with name HTML
*& + Finally an OKCODE variable called FCODE
*&---------------------------------------------------------------------*
*& This code is originally adopted from standard program SAPHTML_DEMO1
*&---------------------------------------------------------------------*
*& URL: http://allaboutsap.blogspot.com
*&---------------------------------------------------------------------*
REPORT ZKAR_BROWSERDEMO.
*----------------------------------------------------------------------*
* DATA DECLARATIONS *
*----------------------------------------------------------------------*
DATA: html_control TYPE REF TO cl_gui_html_viewer,
my_container TYPE REF TO cl_gui_custom_container,
fcode LIKE sy-ucomm,
myevent_tab TYPE cntl_simple_events,
myevent TYPE cntl_simple_event,
edurl(2048),
alignment TYPE i.
*****************************************************
* CLASS cl_myevent_handler *
*****************************************************
CLASS cl_myevent_handler DEFINITION.
PUBLIC SECTION.
METHODS: on_navigate_complete
FOR EVENT navigate_complete OF cl_gui_html_viewer
IMPORTING url.
ENDCLASS. "cl_myevent_handler DEFINITION
DATA: evt_receiver TYPE REF TO cl_myevent_handler.
SET SCREEN 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS 'TESTHTM1'.
SET TITLEBAR '001'.
IF my_container IS INITIAL.
CREATE OBJECT my_container
EXPORTING
container_name = 'HTML'
EXCEPTIONS
others = 1.
CASE sy-subrc.
WHEN 0.
*
WHEN OTHERS.
RAISE cntl_error.
ENDCASE.
ENDIF.
IF html_control IS INITIAL.
CREATE OBJECT html_control
EXPORTING
parent = my_container.
IF sy-subrc NE 0.
RAISE cntl_error.
ENDIF.
* register event
*************************************************************
* DON'T USE the NAVIGATE_COMPLETE event in application logic
*************************************************************
myevent-eventid = html_control->m_id_navigate_complete.
myevent-appl_event = 'X'.
APPEND myevent TO myevent_tab.
CALL METHOD html_control->set_registered_events
EXPORTING
events = myevent_tab.
CREATE OBJECT evt_receiver.
SET HANDLER evt_receiver->on_navigate_complete
FOR html_control.
*--- To load default home page
PERFORM load_home_page.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
CASE fcode.
WHEN 'BACK'.
IF NOT html_control IS INITIAL.
CALL METHOD html_control->free.
FREE html_control.
ENDIF.
IF NOT my_container IS INITIAL.
CALL METHOD my_container->free
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
* MESSAGE E002 WITH F_RETURN.
ENDIF.
FREE my_container.
ENDIF.
LEAVE PROGRAM.
*--- When HOME
WHEN 'HHOM'. " show the home page
CALL METHOD html_control->go_home.
CALL METHOD html_control->get_current_url
IMPORTING
url = edurl.
*--- When BACK
WHEN 'HBAK'.
CALL METHOD html_control->go_back.
CALL METHOD html_control->get_current_url
IMPORTING
url = edurl.
*--- When FORWARD
WHEN 'HFWD'.
CALL METHOD html_control->go_forward.
CALL METHOD html_control->get_current_url
IMPORTING
url = edurl.
*--- When REFRESH
WHEN 'HRFR'.
CALL METHOD html_control->do_refresh.
CALL METHOD html_control->get_current_url
IMPORTING
url = edurl.
WHEN 'HNAV'.
IF NOT edurl IS INITIAL.
CALL METHOD html_control->show_url
EXPORTING
url = edurl
EXCEPTIONS
cnht_error_parameter = 1
OTHERS = 2.
IF sy-subrc GE 2.
RAISE cntl_error.
ENDIF.
ENDIF.
WHEN OTHERS.
CALL METHOD cl_gui_cfw=>dispatch.
ENDCASE.
CLEAR fcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
*& Form load_home_page
*&---------------------------------------------------------------------*
* To load default home page
*----------------------------------------------------------------------*
FORM load_home_page.
DATA: doc_url(80).
CALL METHOD html_control->load_html_document
EXPORTING
document_id = 'HTMLCNTL_CNHTTST1_START'
IMPORTING
assigned_url = doc_url
EXCEPTIONS
OTHERS = 1.
IF sy-subrc EQ 0.
CALL METHOD html_control->show_url
EXPORTING
url = doc_url.
ENDIF.
ENDFORM. " LOAD_HOME_PAGE
****************************************************
* cl_myevent_handler implementation *
****************************************************
CLASS cl_myevent_handler IMPLEMENTATION.
*************************************************************
* DON'T USE the NAVIGATE_COMPLETE event in application logic
*************************************************************
METHOD on_navigate_complete.
edurl = url.
ENDMETHOD. "on_navigate_complete
ENDCLASS. "cl_myevent_handler IMPLEMENTATION
*& Report Z_BROWSERDEMO
*&---------------------------------------------------------------------*
*& This program demonstrates how to add a custom controller to a screen
*& that acts like a nomal web browser. In order to run the program,
*& The following elements are required:
*& + Create SCREEN 100
*& + Create an I/O fieeld with name "EDURL"
*& + Create a custom control with name HTML
*& + Finally an OKCODE variable called FCODE
*&---------------------------------------------------------------------*
*& This code is originally adopted from standard program SAPHTML_DEMO1
*&---------------------------------------------------------------------*
*& URL: http://allaboutsap.blogspot.com
*&---------------------------------------------------------------------*
REPORT ZKAR_BROWSERDEMO.
*----------------------------------------------------------------------*
* DATA DECLARATIONS *
*----------------------------------------------------------------------*
DATA: html_control TYPE REF TO cl_gui_html_viewer,
my_container TYPE REF TO cl_gui_custom_container,
fcode LIKE sy-ucomm,
myevent_tab TYPE cntl_simple_events,
myevent TYPE cntl_simple_event,
edurl(2048),
alignment TYPE i.
*****************************************************
* CLASS cl_myevent_handler *
*****************************************************
CLASS cl_myevent_handler DEFINITION.
PUBLIC SECTION.
METHODS: on_navigate_complete
FOR EVENT navigate_complete OF cl_gui_html_viewer
IMPORTING url.
ENDCLASS. "cl_myevent_handler DEFINITION
DATA: evt_receiver TYPE REF TO cl_myevent_handler.
SET SCREEN 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS 'TESTHTM1'.
SET TITLEBAR '001'.
IF my_container IS INITIAL.
CREATE OBJECT my_container
EXPORTING
container_name = 'HTML'
EXCEPTIONS
others = 1.
CASE sy-subrc.
WHEN 0.
*
WHEN OTHERS.
RAISE cntl_error.
ENDCASE.
ENDIF.
IF html_control IS INITIAL.
CREATE OBJECT html_control
EXPORTING
parent = my_container.
IF sy-subrc NE 0.
RAISE cntl_error.
ENDIF.
* register event
*************************************************************
* DON'T USE the NAVIGATE_COMPLETE event in application logic
*************************************************************
myevent-eventid = html_control->m_id_navigate_complete.
myevent-appl_event = 'X'.
APPEND myevent TO myevent_tab.
CALL METHOD html_control->set_registered_events
EXPORTING
events = myevent_tab.
CREATE OBJECT evt_receiver.
SET HANDLER evt_receiver->on_navigate_complete
FOR html_control.
*--- To load default home page
PERFORM load_home_page.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
CASE fcode.
WHEN 'BACK'.
IF NOT html_control IS INITIAL.
CALL METHOD html_control->free.
FREE html_control.
ENDIF.
IF NOT my_container IS INITIAL.
CALL METHOD my_container->free
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
* MESSAGE E002 WITH F_RETURN.
ENDIF.
FREE my_container.
ENDIF.
LEAVE PROGRAM.
*--- When HOME
WHEN 'HHOM'. " show the home page
CALL METHOD html_control->go_home.
CALL METHOD html_control->get_current_url
IMPORTING
url = edurl.
*--- When BACK
WHEN 'HBAK'.
CALL METHOD html_control->go_back.
CALL METHOD html_control->get_current_url
IMPORTING
url = edurl.
*--- When FORWARD
WHEN 'HFWD'.
CALL METHOD html_control->go_forward.
CALL METHOD html_control->get_current_url
IMPORTING
url = edurl.
*--- When REFRESH
WHEN 'HRFR'.
CALL METHOD html_control->do_refresh.
CALL METHOD html_control->get_current_url
IMPORTING
url = edurl.
WHEN 'HNAV'.
IF NOT edurl IS INITIAL.
CALL METHOD html_control->show_url
EXPORTING
url = edurl
EXCEPTIONS
cnht_error_parameter = 1
OTHERS = 2.
IF sy-subrc GE 2.
RAISE cntl_error.
ENDIF.
ENDIF.
WHEN OTHERS.
CALL METHOD cl_gui_cfw=>dispatch.
ENDCASE.
CLEAR fcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
*& Form load_home_page
*&---------------------------------------------------------------------*
* To load default home page
*----------------------------------------------------------------------*
FORM load_home_page.
DATA: doc_url(80).
CALL METHOD html_control->load_html_document
EXPORTING
document_id = 'HTMLCNTL_CNHTTST1_START'
IMPORTING
assigned_url = doc_url
EXCEPTIONS
OTHERS = 1.
IF sy-subrc EQ 0.
CALL METHOD html_control->show_url
EXPORTING
url = doc_url.
ENDIF.
ENDFORM. " LOAD_HOME_PAGE
****************************************************
* cl_myevent_handler implementation *
****************************************************
CLASS cl_myevent_handler IMPLEMENTATION.
*************************************************************
* DON'T USE the NAVIGATE_COMPLETE event in application logic
*************************************************************
METHOD on_navigate_complete.
edurl = url.
ENDMETHOD. "on_navigate_complete
ENDCLASS. "cl_myevent_handler IMPLEMENTATION
Program to create Material Master data using BAPIs
*&---------------------------------------------------------------------*
*& Report ZHAR_MATMAS_BAPI
*&---------------------------------------------------------------------*
*& This program demonstrates how easy it is to create Material master
*& data using BAPI_MATERIAL_SAVEDATA
*&
*& The program also generates a report post-execution displaying errors
*& as well as successful uploads
*&---------------------------------------------------------------------*
*& URL: http://allaboutsap.blogspot.com
*&---------------------------------------------------------------------*
REPORT ZHAR_MATMAS_BAPI.
*----------------------------------------------------------------------*
* TABLES
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
* FLAGS
*----------------------------------------------------------------------*
DATA: F_STOP. " Flag used to stop processing
*----------------------------------------------------------------------*
* DATA DECLARATIONS
*----------------------------------------------------------------------*
DATA : V_EMPTY TYPE I, " No. of empty records
V_TOTAL TYPE I. " Total no. of records.
*----------------------------------------------------------------------*
* STRUCTURES & INTERNAL TABLES
*----------------------------------------------------------------------*
*--- BAPI structures
DATA: BAPI_HEAD LIKE BAPIMATHEAD, " Header Segment with Control Information
BAPI_MAKT LIKE BAPI_MAKT, " Material Description
BAPI_MARA1 LIKE BAPI_MARA, " Client Data
BAPI_MARAX LIKE BAPI_MARAX, " Checkbox Structure for BAPI_MARA
BAPI_MARC1 LIKE BAPI_MARC, " Plant View
BAPI_MARCX LIKE BAPI_MARCX, " Checkbox Structure for BAPI_MARC
BAPI_MBEW1 LIKE BAPI_MBEW, " Accounting View
BAPI_MBEWX LIKE BAPI_MBEWX, " Checkbox Structure for BAPI_MBEW
BAPI_RETURN LIKE BAPIRET2. " Return Parameter
*--- Internal table to hold excel file data
DATA: IT_INTERN TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
*--- Internal table to hold Matetrial descriptions
DATA: BEGIN OF IT_MAKT OCCURS 100.
INCLUDE STRUCTURE BAPI_MAKT.
DATA: END OF IT_MAKT.
*--- Internal to hold the records in the text file
DATA : BEGIN OF IT_DATA OCCURS 100,
WERKS(4), " Plant
MTART(4), " Material type
MATNR(18), " Material number
MATKL(9) , " Material group
MBRSH(1), " Industry sector
MEINS(3), " Base unit of measure
GEWEI(3), " Weight Unit
SPART(2), " Division
EKGRP(3), " Purchasing group
VPRSV(1), " Price control indicator
STPRS(12), " Standard price
PEINH(3), " Price unit
SPRAS(2), " Language key
MAKTX(40), " Material description
END OF IT_DATA.
*----------------------------------------------------------------------*
* SELECTION SCREEN. *
*----------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK SCR1 WITH FRAME TITLE TEXT-111.
PARAMETER : P_FILE TYPE RLGRAP-FILENAME OBLIGATORY DEFAULT " Input File
'C:\Material_master.XLS'.
PARAMETER : P_MAX(4) OBLIGATORY DEFAULT '100'. " no.of recs in a session
PARAMETERS: P_HEADER TYPE I DEFAULT 0. " Header Lines
PARAMETERS: P_BEGCOL TYPE I DEFAULT 1 NO-DISPLAY,
P_BEGROW TYPE I DEFAULT 1 NO-DISPLAY,
P_ENDCOL TYPE I DEFAULT 100 NO-DISPLAY,
P_ENDROW TYPE I DEFAULT 32000 NO-DISPLAY.
SELECTION-SCREEN END OF BLOCK SCR1.
*---------------------------------------------------------------------*
* AT SELECTION-SCREEN
*---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
*--- Validating file
PERFORM VALIDATE_FILE USING P_FILE.
*----------------------------------------------------------------------*
* START-OF-SELECTION
*----------------------------------------------------------------------*
START-OF-SELECTION.
*--- Perform to convert the Excel data into an internal table
PERFORM CONVERT_XLS_ITAB.
IF NOT IT_DATA[] IS INITIAL.
*--- Perform to delete Header lines
PERFORM DELETE_HEADER_EMPTY_RECS.
ENDIF.
*----------------------------------------------------------------------*
* END OF SELECTION.
*----------------------------------------------------------------------*
END-OF-SELECTION.
*--- Perform to upload Material Master data
PERFORM UPLOAD_MATMAS.
*----------------------------------------------------------------------*
* Form : validate_input_file
*----------------------------------------------------------------------*
* Description : To provide F4 help for file if read from PC
*----------------------------------------------------------------------*
FORM VALIDATE_FILE USING F_FILE TYPE RLGRAP-FILENAME.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
CHANGING
FILE_NAME = F_FILE
EXCEPTIONS
MASK_TOO_LONG = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE S010" 'Error in getting filename'.
ENDIF.
ENDFORM. " validate_input_file
*&---------------------------------------------------------------------*
*& Form CONVER_XLS_ITAB
*&---------------------------------------------------------------------*
* To convert XLS to internal table
*----------------------------------------------------------------------*
FORM CONVERT_XLS_ITAB.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_FILE
I_BEGIN_COL = P_BEGCOL
I_BEGIN_ROW = P_BEGROW
I_END_COL = P_ENDCOL
I_END_ROW = P_ENDROW
TABLES
INTERN = IT_INTERN.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*--- Perform to move the data into an internal data
PERFORM MOVE_DATA.
ENDFORM. " CONVERT_XLS_ITAB
*&---------------------------------------------------------------------*
*& Form MOVE_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM MOVE_DATA.
DATA : LV_INDEX TYPE I.
FIELD-SYMBOLS.
*--- Sorting the internal table
SORT IT_INTERN BY ROW COL.
CLEAR IT_INTERN.
LOOP AT IT_INTERN.
MOVE IT_INTERN-COL TO LV_INDEX.
*--- Assigning the each record to an internal table row
ASSIGN COMPONENT LV_INDEX OF STRUCTURE IT_DATA TO.
*--- Asigning the field value to a field symbol
MOVE IT_INTERN-VALUE TO.
AT END OF ROW.
APPEND IT_DATA.
CLEAR IT_DATA.
ENDAT.
ENDLOOP.
ENDFORM. " MOVE_DATA
*&---------------------------------------------------------------------*
*& Form DELETE_HEADER_EMPTY_RECS
*&---------------------------------------------------------------------*
* To delete the Header and empty records
*----------------------------------------------------------------------*
FORM DELETE_HEADER_EMPTY_RECS.
DATA: LV_TABIX LIKE SY-TABIX.
IF NOT P_HEADER IS INITIAL.
LOOP AT IT_DATA.
IF P_HEADER > 0 AND NOT IT_DATA IS INITIAL.
DELETE IT_DATA FROM 1 TO P_HEADER.
* P_HEADER = 0.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.
CLEAR IT_DATA.
*--- To delete the empty lines from internal table
LOOP AT IT_DATA.
LV_TABIX = SY-TABIX.
IF IT_DATA IS INITIAL.
V_EMPTY = V_EMPTY + 1.
DELETE IT_DATA INDEX LV_TABIX..
ENDIF.
ENDLOOP.
CLEAR IT_DATA.
*--- Total no of recs in file
DESCRIBE TABLE IT_DATA LINES V_TOTAL.
IF V_TOTAL = 0.
MESSAGE I013" No records in the file
F_STOP = 'X'.
STOP.
ENDIF.
ENDFORM. " DELETE_HEADER_EMPTY_RECS
*&---------------------------------------------------------------------*
*& Form UPLOAD_MATMAS
*&---------------------------------------------------------------------*
* to upload Material Master data
*----------------------------------------------------------------------*
FORM UPLOAD_MATMAS .
LOOP AT IT_DATA.
* Header
BAPI_HEAD-MATERIAL = IT_DATA-MATNR.
BAPI_HEAD-IND_SECTOR = IT_DATA-MBRSH.
BAPI_HEAD-MATL_TYPE = IT_DATA-MTART.
BAPI_HEAD-BASIC_VIEW = 'X'.
BAPI_HEAD-PURCHASE_VIEW = 'X'.
BAPI_HEAD-ACCOUNT_VIEW = 'X'.
* Material Description
REFRESH IT_MAKT.
IT_MAKT-LANGU = IT_DATA-SPRAS.
IT_MAKT-MATL_DESC = IT_DATA-MAKTX.
APPEND IT_MAKT.
* Client Data - Basic
BAPI_MARA1-MATL_GROUP = IT_DATA-MATKL.
BAPI_MARA1-BASE_UOM = IT_DATA-MEINS.
BAPI_MARA1-UNIT_OF_WT = IT_DATA-GEWEI.
BAPI_MARA1-DIVISION = IT_DATA-SPART.
BAPI_MARAX-MATL_GROUP = 'X'.
BAPI_MARAX-BASE_UOM = 'X'.
BAPI_MARAX-UNIT_OF_WT = 'X'.
BAPI_MARAX-DIVISION = 'X'.
* Plant - Purchasing
BAPI_MARC1-PLANT = IT_DATA-WERKS.
BAPI_MARC1-PUR_GROUP = IT_DATA-EKGRP.
BAPI_MARCX-PLANT = IT_DATA-WERKS.
BAPI_MARCX-PUR_GROUP = 'X'.
* Accounting
BAPI_MBEW1-VAL_AREA = IT_DATA-WERKS.
BAPI_MBEW1-PRICE_CTRL = IT_DATA-VPRSV.
BAPI_MBEW1-STD_PRICE = IT_DATA-STPRS.
BAPI_MBEW1-PRICE_UNIT = IT_DATA-PEINH.
BAPI_MBEWX-VAL_AREA = IT_DATA-WERKS.
BAPI_MBEWX-PRICE_CTRL = 'X'.
BAPI_MBEWX-STD_PRICE = 'X'.
BAPI_MBEWX-PRICE_UNIT = 'X'.
*--- BAPI to create material
call function 'BAPI_MATERIAL_SAVEDATA'
exporting
HEADDATA = BAPI_HEAD
CLIENTDATA = BAPI_MARA1
CLIENTDATAX = BAPI_MARAX
PLANTDATA = BAPI_MARC1
PLANTDATAX = BAPI_MARCX
* FORECASTPARAMETERS =
* FORECASTPARAMETERSX =
* PLANNINGDATA =
* PLANNINGDATAX =
* STORAGELOCATIONDATA =
* STORAGELOCATIONDATAX =
* VALUATIONDATA = BAPI_MBEW1
* VALUATIONDATAX = BAPI_MBEWX
* WAREHOUSENUMBERDATA =
* WAREHOUSENUMBERDATAX =
* SALESDATA = BAPI_MVKE1
* SALESDATAX = BAPI_MVKEX
* STORAGETYPEDATA =
* STORAGETYPEDATAX =
IMPORTING
RETURN = BAPI_RETURN
TABLES
MATERIALDESCRIPTION = IT_MAKT
* UNITSOFMEASURE =
* UNITSOFMEASUREX =
* INTERNATIONALARTNOS =
* MATERIALLONGTEXT =
* TAXCLASSIFICATIONS =
* RETURNMESSAGES =
* PRTDATA =
* PRTDATAX =
* EXTENSIONIN =
* EXTENSIONINX =
.
IF BAPI_RETURN-TYPE = 'E'.
WRITE:/ 'Error:' ,BAPI_RETURN-MESSAGE ,'for material:' ,it_data-matnr.
ELSEIF BAPI_RETURN-TYPE = 'S'.
WRITE: 'Successfully created material' ,it_data-matnr.
ENDIF.
ENDLOOP.
ENDFORM. " UPLOAD_MATMAS
*& Report ZHAR_MATMAS_BAPI
*&---------------------------------------------------------------------*
*& This program demonstrates how easy it is to create Material master
*& data using BAPI_MATERIAL_SAVEDATA
*&
*& The program also generates a report post-execution displaying errors
*& as well as successful uploads
*&---------------------------------------------------------------------*
*& URL: http://allaboutsap.blogspot.com
*&---------------------------------------------------------------------*
REPORT ZHAR_MATMAS_BAPI.
*----------------------------------------------------------------------*
* TABLES
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
* FLAGS
*----------------------------------------------------------------------*
DATA: F_STOP. " Flag used to stop processing
*----------------------------------------------------------------------*
* DATA DECLARATIONS
*----------------------------------------------------------------------*
DATA : V_EMPTY TYPE I, " No. of empty records
V_TOTAL TYPE I. " Total no. of records.
*----------------------------------------------------------------------*
* STRUCTURES & INTERNAL TABLES
*----------------------------------------------------------------------*
*--- BAPI structures
DATA: BAPI_HEAD LIKE BAPIMATHEAD, " Header Segment with Control Information
BAPI_MAKT LIKE BAPI_MAKT, " Material Description
BAPI_MARA1 LIKE BAPI_MARA, " Client Data
BAPI_MARAX LIKE BAPI_MARAX, " Checkbox Structure for BAPI_MARA
BAPI_MARC1 LIKE BAPI_MARC, " Plant View
BAPI_MARCX LIKE BAPI_MARCX, " Checkbox Structure for BAPI_MARC
BAPI_MBEW1 LIKE BAPI_MBEW, " Accounting View
BAPI_MBEWX LIKE BAPI_MBEWX, " Checkbox Structure for BAPI_MBEW
BAPI_RETURN LIKE BAPIRET2. " Return Parameter
*--- Internal table to hold excel file data
DATA: IT_INTERN TYPE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
*--- Internal table to hold Matetrial descriptions
DATA: BEGIN OF IT_MAKT OCCURS 100.
INCLUDE STRUCTURE BAPI_MAKT.
DATA: END OF IT_MAKT.
*--- Internal to hold the records in the text file
DATA : BEGIN OF IT_DATA OCCURS 100,
WERKS(4), " Plant
MTART(4), " Material type
MATNR(18), " Material number
MATKL(9) , " Material group
MBRSH(1), " Industry sector
MEINS(3), " Base unit of measure
GEWEI(3), " Weight Unit
SPART(2), " Division
EKGRP(3), " Purchasing group
VPRSV(1), " Price control indicator
STPRS(12), " Standard price
PEINH(3), " Price unit
SPRAS(2), " Language key
MAKTX(40), " Material description
END OF IT_DATA.
*----------------------------------------------------------------------*
* SELECTION SCREEN. *
*----------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK SCR1 WITH FRAME TITLE TEXT-111.
PARAMETER : P_FILE TYPE RLGRAP-FILENAME OBLIGATORY DEFAULT " Input File
'C:\Material_master.XLS'.
PARAMETER : P_MAX(4) OBLIGATORY DEFAULT '100'. " no.of recs in a session
PARAMETERS: P_HEADER TYPE I DEFAULT 0. " Header Lines
PARAMETERS: P_BEGCOL TYPE I DEFAULT 1 NO-DISPLAY,
P_BEGROW TYPE I DEFAULT 1 NO-DISPLAY,
P_ENDCOL TYPE I DEFAULT 100 NO-DISPLAY,
P_ENDROW TYPE I DEFAULT 32000 NO-DISPLAY.
SELECTION-SCREEN END OF BLOCK SCR1.
*---------------------------------------------------------------------*
* AT SELECTION-SCREEN
*---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
*--- Validating file
PERFORM VALIDATE_FILE USING P_FILE.
*----------------------------------------------------------------------*
* START-OF-SELECTION
*----------------------------------------------------------------------*
START-OF-SELECTION.
*--- Perform to convert the Excel data into an internal table
PERFORM CONVERT_XLS_ITAB.
IF NOT IT_DATA[] IS INITIAL.
*--- Perform to delete Header lines
PERFORM DELETE_HEADER_EMPTY_RECS.
ENDIF.
*----------------------------------------------------------------------*
* END OF SELECTION.
*----------------------------------------------------------------------*
END-OF-SELECTION.
*--- Perform to upload Material Master data
PERFORM UPLOAD_MATMAS.
*----------------------------------------------------------------------*
* Form : validate_input_file
*----------------------------------------------------------------------*
* Description : To provide F4 help for file if read from PC
*----------------------------------------------------------------------*
FORM VALIDATE_FILE USING F_FILE TYPE RLGRAP-FILENAME.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
CHANGING
FILE_NAME = F_FILE
EXCEPTIONS
MASK_TOO_LONG = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE S010" 'Error in getting filename'.
ENDIF.
ENDFORM. " validate_input_file
*&---------------------------------------------------------------------*
*& Form CONVER_XLS_ITAB
*&---------------------------------------------------------------------*
* To convert XLS to internal table
*----------------------------------------------------------------------*
FORM CONVERT_XLS_ITAB.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = P_FILE
I_BEGIN_COL = P_BEGCOL
I_BEGIN_ROW = P_BEGROW
I_END_COL = P_ENDCOL
I_END_ROW = P_ENDROW
TABLES
INTERN = IT_INTERN.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*--- Perform to move the data into an internal data
PERFORM MOVE_DATA.
ENDFORM. " CONVERT_XLS_ITAB
*&---------------------------------------------------------------------*
*& Form MOVE_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM MOVE_DATA.
DATA : LV_INDEX TYPE I.
FIELD-SYMBOLS
*--- Sorting the internal table
SORT IT_INTERN BY ROW COL.
CLEAR IT_INTERN.
LOOP AT IT_INTERN.
MOVE IT_INTERN-COL TO LV_INDEX.
*--- Assigning the each record to an internal table row
ASSIGN COMPONENT LV_INDEX OF STRUCTURE IT_DATA TO
*--- Asigning the field value to a field symbol
MOVE IT_INTERN-VALUE TO
AT END OF ROW.
APPEND IT_DATA.
CLEAR IT_DATA.
ENDAT.
ENDLOOP.
ENDFORM. " MOVE_DATA
*&---------------------------------------------------------------------*
*& Form DELETE_HEADER_EMPTY_RECS
*&---------------------------------------------------------------------*
* To delete the Header and empty records
*----------------------------------------------------------------------*
FORM DELETE_HEADER_EMPTY_RECS.
DATA: LV_TABIX LIKE SY-TABIX.
IF NOT P_HEADER IS INITIAL.
LOOP AT IT_DATA.
IF P_HEADER > 0 AND NOT IT_DATA IS INITIAL.
DELETE IT_DATA FROM 1 TO P_HEADER.
* P_HEADER = 0.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.
CLEAR IT_DATA.
*--- To delete the empty lines from internal table
LOOP AT IT_DATA.
LV_TABIX = SY-TABIX.
IF IT_DATA IS INITIAL.
V_EMPTY = V_EMPTY + 1.
DELETE IT_DATA INDEX LV_TABIX..
ENDIF.
ENDLOOP.
CLEAR IT_DATA.
*--- Total no of recs in file
DESCRIBE TABLE IT_DATA LINES V_TOTAL.
IF V_TOTAL = 0.
MESSAGE I013" No records in the file
F_STOP = 'X'.
STOP.
ENDIF.
ENDFORM. " DELETE_HEADER_EMPTY_RECS
*&---------------------------------------------------------------------*
*& Form UPLOAD_MATMAS
*&---------------------------------------------------------------------*
* to upload Material Master data
*----------------------------------------------------------------------*
FORM UPLOAD_MATMAS .
LOOP AT IT_DATA.
* Header
BAPI_HEAD-MATERIAL = IT_DATA-MATNR.
BAPI_HEAD-IND_SECTOR = IT_DATA-MBRSH.
BAPI_HEAD-MATL_TYPE = IT_DATA-MTART.
BAPI_HEAD-BASIC_VIEW = 'X'.
BAPI_HEAD-PURCHASE_VIEW = 'X'.
BAPI_HEAD-ACCOUNT_VIEW = 'X'.
* Material Description
REFRESH IT_MAKT.
IT_MAKT-LANGU = IT_DATA-SPRAS.
IT_MAKT-MATL_DESC = IT_DATA-MAKTX.
APPEND IT_MAKT.
* Client Data - Basic
BAPI_MARA1-MATL_GROUP = IT_DATA-MATKL.
BAPI_MARA1-BASE_UOM = IT_DATA-MEINS.
BAPI_MARA1-UNIT_OF_WT = IT_DATA-GEWEI.
BAPI_MARA1-DIVISION = IT_DATA-SPART.
BAPI_MARAX-MATL_GROUP = 'X'.
BAPI_MARAX-BASE_UOM = 'X'.
BAPI_MARAX-UNIT_OF_WT = 'X'.
BAPI_MARAX-DIVISION = 'X'.
* Plant - Purchasing
BAPI_MARC1-PLANT = IT_DATA-WERKS.
BAPI_MARC1-PUR_GROUP = IT_DATA-EKGRP.
BAPI_MARCX-PLANT = IT_DATA-WERKS.
BAPI_MARCX-PUR_GROUP = 'X'.
* Accounting
BAPI_MBEW1-VAL_AREA = IT_DATA-WERKS.
BAPI_MBEW1-PRICE_CTRL = IT_DATA-VPRSV.
BAPI_MBEW1-STD_PRICE = IT_DATA-STPRS.
BAPI_MBEW1-PRICE_UNIT = IT_DATA-PEINH.
BAPI_MBEWX-VAL_AREA = IT_DATA-WERKS.
BAPI_MBEWX-PRICE_CTRL = 'X'.
BAPI_MBEWX-STD_PRICE = 'X'.
BAPI_MBEWX-PRICE_UNIT = 'X'.
*--- BAPI to create material
call function 'BAPI_MATERIAL_SAVEDATA'
exporting
HEADDATA = BAPI_HEAD
CLIENTDATA = BAPI_MARA1
CLIENTDATAX = BAPI_MARAX
PLANTDATA = BAPI_MARC1
PLANTDATAX = BAPI_MARCX
* FORECASTPARAMETERS =
* FORECASTPARAMETERSX =
* PLANNINGDATA =
* PLANNINGDATAX =
* STORAGELOCATIONDATA =
* STORAGELOCATIONDATAX =
* VALUATIONDATA = BAPI_MBEW1
* VALUATIONDATAX = BAPI_MBEWX
* WAREHOUSENUMBERDATA =
* WAREHOUSENUMBERDATAX =
* SALESDATA = BAPI_MVKE1
* SALESDATAX = BAPI_MVKEX
* STORAGETYPEDATA =
* STORAGETYPEDATAX =
IMPORTING
RETURN = BAPI_RETURN
TABLES
MATERIALDESCRIPTION = IT_MAKT
* UNITSOFMEASURE =
* UNITSOFMEASUREX =
* INTERNATIONALARTNOS =
* MATERIALLONGTEXT =
* TAXCLASSIFICATIONS =
* RETURNMESSAGES =
* PRTDATA =
* PRTDATAX =
* EXTENSIONIN =
* EXTENSIONINX =
.
IF BAPI_RETURN-TYPE = 'E'.
WRITE:/ 'Error:' ,BAPI_RETURN-MESSAGE ,'for material:' ,it_data-matnr.
ELSEIF BAPI_RETURN-TYPE = 'S'.
WRITE: 'Successfully created material' ,it_data-matnr.
ENDIF.
ENDLOOP.
ENDFORM. " UPLOAD_MATMAS
Dynamic Selection Screen Fields
*&---------------------------------------------------------------------*
*& Report ZHAR_DYN_SELSCR.
*&---------------------------------------------------------------------*
*& This program demonstrates how easy it is to set selection screen
*& element properties dynamically
*&
*& The program uses 3 radio buttons to set the display and input
*& properties of selection screen fields dynamically
*&---------------------------------------------------------------------*
*& URL: http://allaboutsap.blogspot.com
*&---------------------------------------------------------------------*
REPORT ZHAR_DYN_SELSCR.
*----------------------------------------------------------------------*
* DATABASE TABLES
*----------------------------------------------------------------------*
tables : mara.
*----------------------------------------------------------------------*
* SELECTION SCREEN
*----------------------------------------------------------------------*
selection-screen begin of block b1 with frame.
*--- Radio buttons to set properties
PARAMETERS:
rad1 RADIOBUTTON GROUP rad default 'X' USER-COMMAND radio,
rad2 RADIOBUTTON GROUP rad,
rad3 RADIOBUTTON GROUP rad.
*--- Selection Screen fields
SELECT-OPTIONS:
s_matnr FOR mara-matnr MODIF ID MI1,
s_mtart FOR mara-mtart MODIF ID MI1,
s_mbrsh FOR mara-mbrsh MODIF ID MI2,
s_matkl FOR mara-matkl MODIF ID MI2.
selection-screen end of block b1.
*----------------------------------------------------------------------*
* AT SELECTION SCREEN
*----------------------------------------------------------------------*
at selection-screen output.
loop at screen.
*--- If Radio Button 1 is checked
IF rad1 = 'X'.
IF screen-group1 = 'MI2'.
*--- Fields with MODIF ID MI2 disappear from the screen
screen-input = 0.
screen-invisible = 1.
ENDIF.
*--- If Radio Button 2 is checked
ELSEIF rad2 = 'X'.
IF screen-group1 = 'MI1'.
*--- Fields with MODIF ID MI1 are input-disabled
screen-input = 0.
ENDIF.
*--- If Radio Button 3 is checked
ELSEIF rad3 = 'X'.
IF screen-group1 = 'MI1' or screen-group1 = 'MI2'.
*--- All fields will appear input-enabled
screen-input = 1.
ENDIF.
ENDIF.
*--- MODIFY SCREEN mandatory addition to apply changes to the screen
Modify screen.
endloop.
*& Report ZHAR_DYN_SELSCR.
*&---------------------------------------------------------------------*
*& This program demonstrates how easy it is to set selection screen
*& element properties dynamically
*&
*& The program uses 3 radio buttons to set the display and input
*& properties of selection screen fields dynamically
*&---------------------------------------------------------------------*
*& URL: http://allaboutsap.blogspot.com
*&---------------------------------------------------------------------*
REPORT ZHAR_DYN_SELSCR.
*----------------------------------------------------------------------*
* DATABASE TABLES
*----------------------------------------------------------------------*
tables : mara.
*----------------------------------------------------------------------*
* SELECTION SCREEN
*----------------------------------------------------------------------*
selection-screen begin of block b1 with frame.
*--- Radio buttons to set properties
PARAMETERS:
rad1 RADIOBUTTON GROUP rad default 'X' USER-COMMAND radio,
rad2 RADIOBUTTON GROUP rad,
rad3 RADIOBUTTON GROUP rad.
*--- Selection Screen fields
SELECT-OPTIONS:
s_matnr FOR mara-matnr MODIF ID MI1,
s_mtart FOR mara-mtart MODIF ID MI1,
s_mbrsh FOR mara-mbrsh MODIF ID MI2,
s_matkl FOR mara-matkl MODIF ID MI2.
selection-screen end of block b1.
*----------------------------------------------------------------------*
* AT SELECTION SCREEN
*----------------------------------------------------------------------*
at selection-screen output.
loop at screen.
*--- If Radio Button 1 is checked
IF rad1 = 'X'.
IF screen-group1 = 'MI2'.
*--- Fields with MODIF ID MI2 disappear from the screen
screen-input = 0.
screen-invisible = 1.
ENDIF.
*--- If Radio Button 2 is checked
ELSEIF rad2 = 'X'.
IF screen-group1 = 'MI1'.
*--- Fields with MODIF ID MI1 are input-disabled
screen-input = 0.
ENDIF.
*--- If Radio Button 3 is checked
ELSEIF rad3 = 'X'.
IF screen-group1 = 'MI1' or screen-group1 = 'MI2'.
*--- All fields will appear input-enabled
screen-input = 1.
ENDIF.
ENDIF.
*--- MODIFY SCREEN mandatory addition to apply changes to the screen
Modify screen.
endloop.
BAPI's for Financial Transaction
BAPI's for Financial Transaction:
Financial Transaction: BUS2042
FTR_BUS2042
Change Transaction
BAPI_FTR_CHANGE
Counterconfirm Transaction
BAPI_FTR_COUNTERCONFIRM
Create Transaction
BAPI_FTR_CREATEFROMDATA
Read Transaction Detailed Data
BAPI_FTR_GETDETAIL
Read Transaction List
BAPI_FTR_GETLIST
Reverse Transaction
BAPI_FTR_REVERSE
Roll Over Transaction
BAPI_FTR_ROLLOVER
Settle Transaction
BAPI_FTR_SETTLE
Terminate Transaction
BAPI_FTR_TERMINATE
Financial Transaction: BUS2042
FTR_BUS2042
Change Transaction
BAPI_FTR_CHANGE
Counterconfirm Transaction
BAPI_FTR_COUNTERCONFIRM
Create Transaction
BAPI_FTR_CREATEFROMDATA
Read Transaction Detailed Data
BAPI_FTR_GETDETAIL
Read Transaction List
BAPI_FTR_GETLIST
Reverse Transaction
BAPI_FTR_REVERSE
Roll Over Transaction
BAPI_FTR_ROLLOVER
Settle Transaction
BAPI_FTR_SETTLE
Terminate Transaction
BAPI_FTR_TERMINATE
Wednesday, October 10, 2007
Tuesday, October 9, 2007
How to download image to desktop
a) Use transaction SMW0
b) Select the option Binary Data for Web RFC applns
c) Press F8
d) Press F8 in Package screen also
e) You can see a list of images uploaded to SAP
f) Select required object -> Select the menu web object->Export-> Give a path/filename with relevant extension
g) The image will be stored in your system
b) Select the option Binary Data for Web RFC applns
c) Press F8
d) Press F8 in Package screen also
e) You can see a list of images uploaded to SAP
f) Select required object -> Select the menu web object->Export-> Give a path/filename with relevant extension
g) The image will be stored in your system
Subscribe to:
Posts (Atom)