Monday, July 11, 2011
SAP APO enhancement for AFS
Saturday, October 9, 2010
The final touch (add a htmp page on SAP screen)
public section.
methods: on_sapevent
for event sapevent of cl_gui_html_viewer
importing action frame getdata postdata query_table.
endclass.
data: evt_receiver type ref to cl_myevent_handler.
* CLASS CL_GUI_CFW DEFINITION LOAD.
class cl_myevent_handler implementation.
method on_sapevent.
case action.
WHEN 'ZORD'.
CALL TRANSACTION 'ZORD'.
WHEN 'ZORD_SPLIT'.
CALL TRANSACTION 'ZORD_SPLIT'.
endcase.
endmethod.
if html_control is initial.
prog_repid = sy-repid.
create object my_container
exporting
container_name = 'HTML_CONTROL'.
create object html_control
exporting
parent = my_container.
if sy-subrc ne 0.
* do nothing.
endif.
* register event
myevent-eventid = html_control->m_id_sapevent.
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_sapevent
for html_control.
perform load_graphics.
perform load_home_page.
endif.
exporting
object_id = 'ZSAP_IMG'
object_url = ‘image.jpeg’
exceptions
others = 1.
exporting
document_id = 'ZTEST_PAGE_6'
importing
assigned_url = doc_url
exceptions
others = 1.
if sy-subrc eq 0.
call method html_control->show_url
exporting
url = doc_url.
endif.
Tuesday, March 9, 2010
selection option recommended sign
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name EQ 'S_WERKS-LOW'.
screen-required = 2. "2 is recommended
ENDIF.
MODIFY SCREEN.
ENDLOOP.
Monday, March 8, 2010
selection screen with tabs
SELECTION-SCREEN BEGIN OF SCREEN 101 AS SUBSCREEN .
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_ebeln FOR zconf_stage-ebeln,
s_ebelp FOR zconf_stage-ebelp,
s_bsart FOR ekko-bsart,
s_werks FOR ekpo-werks,
s_matnr FOR ekpo-matnr,
s_lifnr FOR ekko-lifnr,
s_ekgrp FOR ekko-ekgrp,
s_budat FOR zconf_stage-budat,
s_kunnr FOR vbpa-kunnr.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN END OF SCREEN 101.
SELECTION-SCREEN BEGIN OF SCREEN 102 AS SUBSCREEN .
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_ebeln1 FOR zconf_stage-ebeln,
s_bsart1 FOR ekko-bsart,
s_werks1 FOR ekpo-werks ,
s_matnr1 FOR ekpo-matnr,
s_lifnr1 FOR ekko-lifnr,
s_ekgrp1 FOR ekko-ekgrp,
s_budat1 FOR zconf_stage-budat,
s_kunnr1 FOR vbpa-kunnr.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN END OF SCREEN 102.
SELECTION-SCREEN: BEGIN OF TABBED BLOCK mytab FOR 24 LINES,
TAB (30) button1 USER-COMMAND on,
TAB (30) button2 USER-COMMAND auto,
END OF BLOCK mytab.
INITIALIZATION.
button1 = text-011.
button2 = text-012.
mytab-prog = sy-repid.
mytab-dynnr = 101.
mytab-activetab = 'BUTTON1'.
AT SELECTION-SCREEN .
IF sy-batch = 'X'.
mytab-dynnr = 102.
mytab-activetab = 'BUTTON2'.
sy-ucomm = 'AUTO'.
ENDIF.
CASE sy-dynnr.
WHEN 1000.
CASE sy-ucomm.
WHEN 'ON'.
mytab-dynnr = 101.
mytab-activetab = 'BUTTON1'.
WHEN 'AUTO'.
mytab-dynnr = 102.
mytab-activetab = 'BUTTON2'.
endcase.
WHEN 0101.
mytab-dynnr = 101.
mytab-activetab = 'BUTTON1'.
WHEN 'ONLI'.
PERFORM screen_validation101.
ENDCASE.
WHEN 0102.
mytab-dynnr = 102.
mytab-activetab = 'BUTTON2'.
case sy-ucomm.
WHEN 'ONLI'.
PERFORM screen_validation102.
ENDCASE.
ENDCASE.
START-OF-SELECTION.
CASE mytab-activetab.
WHEN 'BUTTON1'."online mode
WHEN 'BUTTON2'." when automatic
ENDCASE.
now the above code is to a selection screen with tabs that you code using a report program.( this code cannot be used in module pool program )
When a customer request to a selection screen with tabs there can be 2 reasons.
1) To group a selection on one out put ( I mean the final out-put is one but selection screen can be with tabs to make things clear for e.g on SD related report the tabs can be Material selection , SO selection like wise )
2) The user requires different kind of out comes with different tabs... for e.g tab no1 to work during online operations and tab no 2 to work on background operations.
The above requirement 1 which will be totally fine with the code given on top. But the requirement 2 will be a issue when it comes to the above code. As most of the developers know on a selection screen we will always have mandatory fields. when switching between tabs the selection screen first calls the validation and then it calls the normal screen code ( as you know the validation is automatic if me make a selection option mandatory and we have no say on it ).
So in case if the user wants the functionality of the tab 2 he first has to fill all the mandatory fields on tab 1 so that the error wont occur. This was a error I had to face during my development for this there are 2 way outs
1) do the validation by your self ( draw back : you wont get the mandatory sign on the selection screen )
2) write a selection screen with tabs ( draw back : the user wont be able to save variants or this part has to be coded which will be a messy job )
for the 2nd option on above to make sure the tab switching with happen without first validating you have to do the codding as follows
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
MODULE set_tabs.
call SUBSCREEN SUB INCLUDING sy-repid gv_dynnr.
*
PROCESS AFTER INPUT.
MODULE exit_comm.
MODULE switch_tab.
CALL SUBSCREEN SUB.
MODULE screen_comm.
MODULE USER_COMMAND_0100.
before call sub screen you have to call a module switch tabs.
on my case my customer wanted the variants to be there. Therefore they agreed to the validation by code where the mandatory sign is not displayed.
Wednesday, September 16, 2009
when and where we can use parallel cursor
Friday, September 11, 2009
Copy to Clipborad SAP
Bellow code is how to copy data to clipboard. This feature helps you when there is a BDC recording and you want to add selection extended options
DATA: v_rc TYPE I,
it_data TYPE STANDARD TABLE OF CHAR128,
wa_data TYPE char128.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>CLIPBOARD_EXPORT
IMPORTING DATA = it_data
CHANGING RC = v_rc .
Monday, August 31, 2009
How to add a button on selection screen
one small thing I came across on a customer development was to add a button on the selection screen. I have not done such a requirement before for any customer so i didn't any idea on how to do it.
After doing some searching this is what I found out was :).
For a selection screen you can put up to 5 buttons this is a default feature which is available to use if you want.
For that these are the steps you have to do
I have added the button in two ways one is just the button with the text next one button with a icon.
The data declarations for these are.
TABLES: sscrfields.
DATA: functxt TYPE smp_dyntxt.
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME
TITLE TEXT-001.
SELECT-OPTIONS: p_ktopl FOR t030-ktopl.
SELECTION-SCREEN END OF BLOCK block1.
SELECTION-SCREEN FUNCTION KEY 1.
SELECTION-SCREEN FUNCTION KEY 2.
functxt-icon_id = ICON_HISTORY.
functxt-quickinfo = 'log'(001).
sscrfields-functxt_01 = functxt.
MOVE 'Maintain Item Cat.' TO sscrfields-functxt_02.
Thursday, July 16, 2009
how to add tooltip to icon
its very easy to add tooltip to icon's
1) have a icon field in output table ( this can be a char field with 25 characters)
2) in case if you cant to add the lock icon for that icon field put
in this @06@ is the icon when you give the tooltip with '\QXXXtooltipXXX'
insert this part beore last @.
Note: if you want to find the icons check icon table :)
3) field catalog make the icon field 'X'.
there is a SAP example on program: BCALV_DEMO_TOOLTIP
Tuesday, June 23, 2009
How to Debug any screen on SAP
[FUNCTION]
Command=/H
Title=Debugger
Type=SystemCommand
when ever you want to debug you dont have to use /h but just drag and drop this on the SAP screen this enables you to debug on popup screens
Hope this will be useful
nafran
Wednesday, June 10, 2009
how to get the first day and last day SAP
*get first and last date of month and year
CONCATENATE s_bdatj-low s_mnr-low '01' INTO gv_date1.
gv_month = s_mnr-low .
gv_month = gv_month + 01.
CONCATENATE s_bdatj-low gv_month '01' INTO gv_date2.
gv_date2 = gv_date2 - 1.
Thursday, April 23, 2009
Use of binary search option
When a programmer uses the read command, the table is sequentially searched. This slows down the processing. Instead of this, use the binary search addition. The binary search algorithm helps faster search of a value in an internal table. It is advisable to sort the internal table before doing a binary search. Binary search repeatedly divides the search interval in half. If the value to be searched is less than the item in the middle of the interval, the search is narrowed to the lower half, otherwise the search is narrowed to the upper half.
Not Recommended
Read table int_fligh with key airln = ‘LF’.
Recommended
Read table int_fligh with key airln = ‘LF’ binary search.
source: http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_BinarySearch.asp
Modifying a group of lines of an internal table
Use the variations of the modify command to speed up this kind of processing.
Not recommended
Loop at int_fligh.
If int_fligh-flag is initial.
Int_fligh-flag = ‘X’.
Endif.
Modify int_fligh.
Endloop.
Recommended
Int_fligh-flag = ‘X’.
Modify int_fligh transporting flag where flag is initial.
source: http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_ModifyingGroupOfLines.asp
Wednesday, April 15, 2009
copy ALV layouts from a one program to another
*& Report Z_COPY_ALV_VARNTS_PROG_TO_PROG
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_COPY_ALV_VARNTS_PROG_TO_PROG.
* =====================================================================
* Data Declarations Section
* =====================================================================
* ---------------------------------------------------------------------
DATA : BEGIN OF MYLTDX OCCURS 0 .
INCLUDE STRUCTURE LTDX .
DATA : END OF MYLTDX .
* ---------------------------------------------------------------------
DATA : BEGIN OF MYLTDXT OCCURS 0 .
INCLUDE STRUCTURE LTDXT .
DATA : END OF MYLTDXT .
* ---------------------------------------------------------------------
DATA : BEGIN OF MYLTDXD OCCURS 0 .
INCLUDE STRUCTURE LTDXD .
DATA : END OF MYLTDXD .
* ---------------------------------------------------------------------
DATA : MANS(1) TYPE C .
DATA : PROGRAMM LIKE RS38M-PROGRAMM .
DATA : BEGIN OF MDYNPFIELDS OCCURS 1 .
INCLUDE STRUCTURE DYNPREAD .
DATA : END OF MDYNPFIELDS .
CONSTANTS BUTTONSELECTED(1) TYPE C VALUE 'X' .
* =====================================================================
* Macro for Inputing Filenames
* =====================================================================
DEFINE GET_FILENAME .
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
* DEF_FILENAME = ' '
DEF_PATH = &1
MASK = ',*.*,*.*.'
MODE = '0'
* TITLE = ' '
IMPORTING
FILENAME = &2
* RC =
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5.
END-OF-DEFINITION .
* =====================================================================
* Macro for Downloading to ASCII Files
* =====================================================================
DEFINE DOWNLOAD_TO_ASCII .
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
* BIN_FILESIZE = ' '
* CODEPAGE = ' '
FILENAME = &1
FILETYPE = 'DAT'
* MODE = ' '
* WK1_N_FORMAT = ' '
* WK1_N_SIZE = ' '
* WK1_T_FORMAT = ' '
* WK1_T_SIZE = ' '
* COL_SELECT = ' '
* COL_SELECTMASK = ' '
* NO_AUTH_CHECK = ' '
* IMPORTING
* FILELENGTH =
TABLES
DATA_TAB = &2
* FIELDNAMES =
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
GUI_REFUSE_FILETRANSFER = 8
OTHERS = 9.
END-OF-DEFINITION .
* =====================================================================
* Macro for uploading Data from ASCII files
* =====================================================================
DEFINE UPLOAD_FROM_ASCII .
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
* CODEPAGE = ' '
FILENAME = &1
FILETYPE = 'DAT'
* HEADLEN = ' '
* LINE_EXIT = ' '
* TRUNCLEN = ' '
* USER_FORM = ' '
* USER_PROG = ' '
* IMPORTING
* FILELENGTH =
TABLES
DATA_TAB = &2
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TABLE_WIDTH = 4
INVALID_TYPE = 5
NO_BATCH = 6
UNKNOWN_ERROR = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
END-OF-DEFINITION .
* =====================================================================
* Selection Screen Default
* =====================================================================
PARAMETERS : P_FROM_P LIKE RS38M-PROGRAMM OBLIGATORY .
PARAMETERS : P_TO_P LIKE RS38M-PROGRAMM OBLIGATORY .
PARAMETERS : P_SAME_S RADIOBUTTON GROUP GRP1 DEFAULT 'X' .
PARAMETERS : P_DOWNLD RADIOBUTTON GROUP GRP1 .
PARAMETERS : P_UPLOAD RADIOBUTTON GROUP GRP1 .
PARAMETERS : P_FILE_x LIKE RLGRAP-FILENAME DEFAULT 'c:\LTDX.txt' .
PARAMETERS : P_FILE_t LIKE RLGRAP-FILENAME DEFAULT 'c:\LTDXT.txt' .
PARAMETERS : P_FILE_d LIKE RLGRAP-FILENAME DEFAULT 'c:\LTDXD.txt' .
* =====================================================================
* At Selection Screen Events
* =====================================================================
AT SELECTION-SCREEN .
PROGRAMM = P_FROM_P .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE_x .
GET_FILENAME 'c:\LTDX.txt' P_FILE_x .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE_t .
GET_FILENAME 'c:\LTDXT.txt' P_FILE_t .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE_d .
GET_FILENAME 'c:\LTDXD.txt' P_FILE_d .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FROM_P .
CLEAR MDYNPFIELDS . REFRESH MDYNPFIELDS .
MDYNPFIELDS-FIELDNAME = 'P_FROM_P' .
APPEND MDYNPFIELDS .
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = MDYNPFIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11.
READ TABLE MDYNPFIELDS INDEX 1 .
PROGRAMM = MDYNPFIELDS-FIELDVALUE .
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
OBJECT_TYPE = 'PROG'
OBJECT_NAME = PROGRAMM
IMPORTING
OBJECT_NAME_SELECTED = PROGRAMM
EXCEPTIONS
CANCEL = 1
WRONG_TYPE = 2
OTHERS = 3.
P_FROM_P = PROGRAMM .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_TO_P .
CLEAR MDYNPFIELDS . REFRESH MDYNPFIELDS .
MDYNPFIELDS-FIELDNAME = 'P_TO_P' .
APPEND MDYNPFIELDS .
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = MDYNPFIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11.
READ TABLE MDYNPFIELDS INDEX 1 .
PROGRAMM = MDYNPFIELDS-FIELDVALUE .
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
OBJECT_TYPE = 'PROG'
OBJECT_NAME = PROGRAMM
IMPORTING
OBJECT_NAME_SELECTED = PROGRAMM
EXCEPTIONS
CANCEL = 1
WRONG_TYPE = 2
OTHERS = 3.
P_TO_P = PROGRAMM .
* =====================================================================
* Start of Selection
* =====================================================================
START-OF-SELECTION .
CASE BUTTONSELECTED.
WHEN P_SAME_S .
PERFORM COPY_FROM_PROG_TO_PROG .
WHEN P_DOWNLD .
PERFORM VDOWNLOAD .
WHEN P_UPLOAD .
PERFORM VUPLOAD .
ENDCASE .
*&---------------------------------------------------------------------*
*& Form COPY_FROM_PROG_TO_PROG
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM COPY_FROM_PROG_TO_PROG.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
* DEFAULTOPTION = 'Y'
TEXTLINE1 = 'Are you sure you want to copy Variants ? '
* TEXTLINE2 = ' '
TITEL = 'Confirmation '
* START_COLUMN = 25
* START_ROW = 6
* CANCEL_DISPLAY = 'X'
IMPORTING
ANSWER = MANS
EXCEPTIONS
OTHERS = 1.
IF MANS = 'J' .
* ---------------------------------------------------------------------
REFRESH MYLTDX . CLEAR MYLTDX .
SELECT * FROM LTDX INTO TABLE MYLTDX
WHERE REPORT = P_FROM_P.
LOOP AT MYLTDX .
MYLTDX-REPORT = P_TO_P .
MODIFY MYLTDX .
ENDLOOP .
IF SY-SUBRC = 0 .
DELETE FROM LTDX WHERE REPORT = P_TO_P .
INSERT LTDX FROM TABLE MYLTDX .
ENDIF .
* ---------------------------------------------------------------------
REFRESH MYLTDXT . CLEAR MYLTDXT .
SELECT * FROM LTDXT INTO TABLE MYLTDXT
WHERE REPORT = P_FROM_P.
LOOP AT MYLTDXT .
MYLTDXT-REPORT = P_TO_P .
MODIFY MYLTDXT .
ENDLOOP .
IF SY-SUBRC = 0 .
DELETE FROM LTDXT WHERE REPORT = P_TO_P .
INSERT LTDXT FROM TABLE MYLTDXT .
ENDIF .
* ---------------------------------------------------------------------
REFRESH MYLTDXT . CLEAR MYLTDXT .
SELECT * FROM LTDXT INTO TABLE MYLTDXT
WHERE REPORT = P_FROM_P.
LOOP AT MYLTDXT .
MYLTDXT-REPORT = P_TO_P .
MODIFY MYLTDXT .
ENDLOOP .
IF SY-SUBRC = 0 .
DELETE FROM LTDXT WHERE REPORT = P_TO_P .
INSERT LTDXT FROM TABLE MYLTDXT .
ENDIF .
* ---------------------------------------------------------------------
ENDIF .
ENDFORM. " COPY_FROM_PROG_TO_PROG
*&---------------------------------------------------------------------*
*& Form VDOWNLOAD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM VDOWNLOAD.
REFRESH MYLTDX . CLEAR MYLTDX .
SELECT * FROM LTDX INTO TABLE MYLTDX
WHERE REPORT = P_FROM_p.
DOWNLOAD_TO_ASCII P_FILE_x MYLTDX .
* ---------------------------------------------------------------------
REFRESH MYLTDXT . CLEAR MYLTDXT .
SELECT * FROM LTDXT INTO TABLE MYLTDXT
WHERE REPORT = P_FROM_P.
DOWNLOAD_TO_ASCII P_FILE_t MYLTDXT .
* ---------------------------------------------------------------------
REFRESH MYLTDXT . CLEAR MYLTDXT .
SELECT * FROM LTDXD INTO TABLE MYLTDXT
WHERE REPORT = P_FROM_P.
DOWNLOAD_TO_ASCII P_FILE_d MYLTDXT .
* ---------------------------------------------------------------------
ENDFORM. " VDOWNLOAD
*&---------------------------------------------------------------------*
*& Form VUPLOAD
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM VUPLOAD.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
* DEFAULTOPTION = 'Y'
TEXTLINE1 =
'Are you sure you want to upload Variants ? '
* TEXTLINE2 = ' '
TITEL = 'Confirmation '
* START_COLUMN = 25
* START_ROW = 6
* CANCEL_DISPLAY = 'X'
IMPORTING
ANSWER = MANS
EXCEPTIONS
OTHERS = 1.
IF MANS = 'J' .
* ---------------------------------------------------------------------
REFRESH MYLTDX . CLEAR MYLTDX .
UPLOAD_FROM_ASCII P_FILE_x MYLTDX .
LOOP AT MYLTDX .
MYLTDX-REPORT = P_TO_P .
MODIFY MYLTDX .
ENDLOOP .
IF SY-SUBRC = 0 .
DELETE FROM LTDX WHERE REPORT = P_TO_P .
INSERT LTDX FROM TABLE MYLTDX .
ENDIF .
* ---------------------------------------------------------------------
REFRESH MYLTDXT . CLEAR MYLTDXT .
UPLOAD_FROM_ASCII P_FILE_t MYLTDXT .
LOOP AT MYLTDXT .
MYLTDXT-REPORT = P_TO_P .
MODIFY MYLTDXT .
ENDLOOP .
IF SY-SUBRC = 0 .
DELETE FROM LTDXT WHERE REPORT = P_TO_P .
INSERT LTDXT FROM TABLE MYLTDXT .
ENDIF .
* ---------------------------------------------------------------------
REFRESH MYLTDXD . CLEAR MYLTDXD .
UPLOAD_FROM_ASCII P_FILE_d MYLTDXT .
LOOP AT MYLTDXT .
MYLTDXT-REPORT = P_TO_P .
MODIFY MYLTDXT .
ENDLOOP .
IF SY-SUBRC = 0 .
DELETE FROM LTDXT WHERE REPORT = P_TO_P .
INSERT LTDXT FROM TABLE MYLTDXT .
ENDIF .
* ---------------------------------------------------------------------
ENDIF .
ENDFORM. " VUPLOAD
