Fm for popup_to_confirm
hi,
i use th fm of popup_to_confirm but i want some text written over the
confirmation of data i.e in the module field of DIAGNOSE_OBJECT
i am given 'my name'
but it give the text as *** No long texts found! ***
then my message to save of.
so i want in asterick fields 'my name is written'.
plz help me its urgent
thanks
hi jayant
dear use this FM CJWI_POPUP_TO_CONFIRM_STEP
reward if helpful
thanks and regards
snehi chouhan
Similar Messages
-
Batch input for IQ02 not accepting "yes" for 'POPUP_TO_CONFIRM'
Hello,
I wrote a batch input for a transaction (IQ02) and all works fine except one thing:
-when all data is entered and SAVE button is pressed, there is an additional pop-up, from an user exit which needs an YES/NO answer.
The function module used to display the popup is: 'POPUP_TO_CONFIRM'
I do not manage to press the YES button. This is the data I receive when pressing F1 on YES button:
Program SAPLSPO1
Function OPT1
Normally, in batch input, this is the way I pass user-commands:
PERFORM bdc_dynpro USING 'SAPMIEQ0' '0101'.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
But it's not working for this particular situation.
Any ideas?
Thank you.
Edited by: Julius Bussche on Jan 5, 2009 2:07 PM
Quality of subject title improved.Hi
Find out under which condition popups appears.
for that condition you have to put the following code
PERFORM bdc_dynpro USING 'SAPLSPO1' ''<SCREEN_NUMBER>'.
PERFORM bdc_field USING 'BDC_OKCODE' '=OPT1' .
Hope this helps,
Rajat -
Regarding Obsolete Function Modules
Hi all,
can anybody tell me the alternative ECC6.0 function modules of the following Obsolete function modules
DOWNLOAD
UPLOAD
WS_DOWNLOAD
WS_UPLOAD
WS_FILENAME_GET
WS_QUERY
POPUP_TO_CONFIRM_STEP
POPUP_TO_CONFIRM_WITH_MESSAGE
thnks
Sandeephere are replacement function modules for the obsolete ones.
award points in case u feel this useful
1. Obsolete Function Module: WS_UPLOAD.
Replacement FM: GUI_UPLOAD.
Note:
1. If the FM WS_UPLOAD' has file type as ASC, then we can use same file
type ASC for GUI_UPLOAD also.
2. But if the FM 'WS_UPLOAD' has file type as DAT, we can not use DAT for
'GUI_UPLOAD' as it will give short dump.
In this case we need use file type as ASC
and
HAS_FIELD_SEPARATOR = X.
3. If the file name or file type of ws_upload have variables or constants
Instead of hard coding, then dont use hard code values for gui_upload.
3. The data type of file name always should be of character type for gui_upload
The file type should be of Type Character and length 10.
4. Always uncomment the exceptions for gui_upload.
5. And also uncomment the code inside IF SY-SUBRC <> 0. and ENDIF after
gui_upload if the customer has not handled any exception in 46c version.
If there is any code inside IF SY-SUBRC <> 0 and ENDIF for ws_upload in 46c
version, Please use the same code in ECC also after gui_upload.
Example:
Example for File type ASC:
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = P_FILE
FILETYPE = 'ASC'
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = P_I_DATA
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.
Replacement FM:
DATA L_P_FILE TYPE STRING.
L_P_FILE = P_FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = L_P_FILE
FILETYPE = ASC
TABLES
DATA_TAB = P_I_DATA
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.
MESSAGE E033 WITH P_FILE ' could not be opened'(E03).
ENDIF.
Example for file type DAT:
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = P_FILE
FILETYPE = 'DAT'
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = P_I_DATA
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.
Replacement FM:
DATA L_P_FILE TYPE STRING.
L_P_FILE = P_FILE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = L_P_FILE
FILETYPE = ASC
HAS_FIELD_SEPARATOR = X
TABLES
DATA_TAB = P_I_DATA
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 <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
Else.
2. Obsolete FM : WS_DOWNLOAD
Replacement FM: GUI_DOWNLOAD.
Note:
1. If the FM WS_DOWNLOAD' has file type as ASC, then we can use same file
Type ASC for GUI_DOWNLOAD also.
2. If the FM 'WS_DOWNLOAD' has file type as DAT, we can use DAT for
'GUI_DOWNLOAD'
3. If the file name or file type of ws_upload have variables or constants
Instead of hard coding,then dont use hard code values for gui_download.
Declare variables and assign the ws_download variables to new variables
and use These in the new FM.
4. The data type of file name always should be of character type for gui_upload
The file type should be of Type Character and length 10.
5. The data type of file name always should be of character type for gui_ download.
6. Always uncomment the exceptions for gui_download.
7. And also uncomment the code inside IF SY-SUBRC <> 0. and ENDIF after
Gui_upload if the customer has not handled any exception in 46c version.
If there is any code inside IF SY-SUBRC <> 0 and ENDIF for ws_ download in
46c version, Please use the same code in ECC also after gui_download.
Example:
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = P_FILENM
FILETYPE = 'DAT' " split into records
TABLES
DATA_TAB = L_ITAB
FIELDNAMES = T_HEAD
EXCEPTIONS
FILE_OPEN_ERROR = 01
FILE_WRITE_ERROR = 02
INVALID_FILESIZE = 03
INVALID_TABLE_WIDTH = 04
INVALID_TYPE = 05
NO_BATCH = 06
UNKNOWN_ERROR = 07.
Replacement FM for above FM:
DATA L_P_FILE TYPE STRING.
L_P_FILE = P_FILENM.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = L_P_FILE
FILETYPE = DAT
TABLES
DATA_TAB = L_ITAB
FIELDNAMES = T_HEAD
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.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
*EXPORTING
*defaultoption = 'N'
* extline1 = 'Soll das Include überschrieben werden?'(034)
* extline2 = i_inc-include
* itel = 'Include existiert bereits!'(039)
START_COLUMN = 25
START_ROW = 6
CANCEL_DISPLAY = 'X'
IMPORTING
answer = answer
EXCEPTIONS
OTHERS = 1.
Replacement Method :
DATA : l_question type string.
Concatenate 'Soll das Include überschrieben werden?'(034)
i_inc-include
into l_question.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = 'Prepack deletion'(019)
DIAGNOSE_OBJECT = ' '
TEXT_QUESTION = l_question
TEXT_BUTTON_1 = 'Yes'(020)
*ICON_BUTTON_1 = ' '
TEXT_BUTTON_2 = 'No'(021)
*ICON_BUTTON_2 = ' '
*DEFAULT_BUTTON = '2'
DISPLAY_CANCEL_BUTTON = 'X'
*USERDEFINED_F1_HELP = ' '
*START_COLUMN = 25
*START_ROW = 6
*POPUP_TYPE =
*IV_QUICKINFO_BUTTON_1 = ' '
*IV_QUICKINFO_BUTTON_2 = ' '
IMPORTING
ANSWER = answer
TABLES
*PARAMETER =
EXCEPTIONS
TEXT_NOT_FOUND = 1
OTHERS = 2 .
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Note :
In FM POPUP_TO_CONFIRM_STEP' , the value for import parameter ANSWER is
J (YES),
N (NO).
But for POPUP_TO_CONFIRM , the value for import parameter ANSWER is
1 (YES),
2 (NO).
So, please change these values accordingly while replacing with the new FM.
CALL FUNCTION 'POPUP_TO_CONFIRM_WITH_MESSAGE'
EXPORTING
DIAGNOSETEXT1 = TEXT-900
DIAGNOSETEXT2 = SY-MSGV1
DIAGNOSETEXT3 = TEXT-901
TEXTLINE1 = TEXT-902
TEXTLINE2 = TEXT-903
TITEL = TEXT-904
IMPORTING
ANSWER = UP_ANSWER.
replacement:
The Diagnose object parameter Z_ZIMPCHK1_POPUP_TO_CONFIRM'
is created in SE61 transaction as DIALOG TEXT object
DATA: W_PARAM TYPE SPAR,
I_PARAMETERS TYPE STANDARD TABLE OF SPAR,
W_TEXT_Q TYPE STRING.
MOVE TEXT-900 TO W_PARAM-VALUE.
MOVE 'TEXT1' TO W_PARAM-PARAM.
APPEND W_PARAM TO I_PARAMETERS.
WRITE SY-MSGV1 TO W_PARAM-VALUE.
MOVE 'TEXT2' TO W_PARAM-PARAM.
APPEND W_PARAM TO I_PARAMETERS.
WRITE TEXT-901 TO W_PARAM-VALUE.
MOVE 'TEXT3' TO W_PARAM-PARAM.
APPEND W_PARAM TO I_PARAMETERS.
CONCATENATE TEXT-902
TEXT-903
INTO
W_TEXT_Q.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = TEXT-904
DIAGNOSE_OBJECT = 'Z_ZIMPCHK1_POPUP_TO_CONFIRM'
TEXT_QUESTION = W_TEXT_Q
IMPORTING
ANSWER = UP_ANSWER
TABLES
PARAMETER = I_PARAMETERS
EXCEPTIONS
TEXT_NOT_FOUND = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
call function 'UPLOAD'
exporting
filename = umsfile
filetype = 'ASC'
tables
data_tab = umsatz.
replacement :
DATA : I_FILE_TABLE1 TYPE TABLE OF FILE_TABLE,
W_FILETABLE1 TYPE FILE_TABLE,
W_RC1 TYPE I,
W_P_DEF_FILE1 TYPE STRING,
W_P_FILE1 TYPE STRING,
w_usr_act1 TYPE I.
W_P_DEF_FILE1 = umsfile.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
WINDOW_TITLE =
DEFAULT_EXTENSION =
DEFAULT_FILENAME = W_P_DEF_FILE1
CHANGING
FILE_TABLE = I_FILE_TABLE1
RC = W_RC1
USER_ACTION = w_usr_act1
FILE_ENCODING =
EXCEPTIONS
FILE_OPEN_DIALOG_FAILED = 1
CNTL_ERROR = 2
ERROR_NO_GUI = 3
NOT_SUPPORTED_BY_GUI = 4
others = 5 .
IF sy-subrc = 0
AND w_usr_act <>
CL_GUI_FRONTEND_SERVICES=>ACTION_CANCEL.
LOOP AT I_FILE_TABLE1 INTO W_FILETABLE1.
W_P_FILE1 = W_FILETABLE1.
EXIT.
ENDLOOP.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = W_P_FILE1
FILETYPE = 'ASC'
TABLES
DATA_TAB = umsatz
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 <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
BIN_FILESIZE = ' '
CODEPAGE = ' '
FILENAME = PT_FILE
FILETYPE = 'DAT'
ITEM = ' '
MODE = ' '
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
FILEMASK_MASK = ' '
FILEMASK_TEXT = ' '
FILETYPE_NO_CHANGE = ' '
FILEMASK_ALL = ' '
FILETYPE_NO_SHOW = ' '
SILENT = 'S'
COL_SELECT = ' '
COL_SELECTMASK = ' '
NO_AUTH_CHECK = ' '
IMPORTING
ACT_FILENAME =
ACT_FILETYPE =
FILESIZE =
CANCEL =
TABLES
DATA_TAB = BELEGE
FIELDNAMES =
EXCEPTIONS
INVALID_FILESIZE = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
OTHERS = 7.
replacement:
DATA: l_filename TYPE string,
l_filen TYPE string,
l_path TYPE string,
l_fullpath TYPE string,
l_usr_act TYPE I.
l_filename = PT_FILE.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
EXPORTING
DEFAULT_FILE_NAME = l_filename
CHANGING
FILENAME = l_filen
PATH = l_path
FULLPATH = l_fullpath
USER_ACTION = l_usr_act
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
others = 4.
IF sy-subrc = 0
AND l_usr_act <>
CL_GUI_FRONTEND_SERVICES=>ACTION_CANCEL.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = l_fullpath
FILETYPE = 'DAT'
TABLES
DATA_TAB = BELEGE
FIELDNAMES =
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. -
ALV Grid user command handling
I am handling user command event of class cl_gui_alv_grid.
In this , on click of a button , a pop up for selection criterion comes after which
I have to append some data on alv.
But I want to append this data only on frontend not on global internal table of alv
as I want data change event to be called after this and doing some validations on this data.
How can I upload data only on frontend and how to trigger data_changed method in user command event.
I tried using check_changed_data of class cl_gui_alv_grid but some dump is coming for an attribute save_allowed of the class.Hi Suneel,
For you requirement, I dont see why you cant include the functionality for the pop up within the USER_COMMAND event itself.
Algorithm for the USER_COMMAND event:
Step 1: Check E_UCOMM is 'ADD' or 'DELT'.
Step 2: If yes, call FM for POPUP_TO_CONFIRM; else continue to other E_UCOMM
Step 3: If ans is 'No', exit Method - else continue with Add/ Delete as required
Cheers,
Aditya -
Hi,
I have created an ALV grid control and I am also handling the before_user_command event of cl_gui_alv_grid class.
My aim is to use POPUP_TO_CONFIRM function module when the users click on the add/delete row button.
Control is going to the event if I am clicking on any other button of the control except add/delete row buttons.
And in the class attributes those operation description is saying they are local.
Please let me know how make control to go to before_user_command event when users click on add/delete button.
Thanks in advance,
Suneel CHi Suneel,
For you requirement, I dont see why you cant include the functionality for the pop up within the USER_COMMAND event itself.
Algorithm for the USER_COMMAND event:
Step 1: Check E_UCOMM is 'ADD' or 'DELT'.
Step 2: If yes, call FM for POPUP_TO_CONFIRM; else continue to other E_UCOMM
Step 3: If ans is 'No', exit Method - else continue with Add/ Delete as required
Cheers,
Aditya -
Save_dialog func module
hai abapers,
i am having a requirement to call the func module of save dialog box in the prog.Hi Atteq
Do i interpret your question as: you want a function module which gives you a pop-up to confirm when you do something (any event) to save something?
If my interpretation is right, pls check:
POPUP_TO_CONFIRM
POPUP_TO_CONFIRM_STEP
These is a very generic function module, you can try searching more using keywords: popup or popupsave*
Example:
call function 'POPUP_TO_CONFIRM'
exporting
titel = 'Title for POPUP_TO_CONFIRM'(A01)
diagnose_object = 'TEXT1_ZUM_POPUP_TO_CONFIRM'
text_question = 'Do you want to carry out this
fantastic test?'(A02)
text_button_1 = 'Yes'(A03)
ICON_BUTTON_1 = 'ICON_OKAY'
text_button_2 = 'Cancel'(A04)
ICON_BUTTON_2 = 'ICON_CANCEL'
DEFAULT_BUTTON = '1'
DISPLAY_CANCEL = ''
userdefined_f1_help = 'TEST_TEXT_ZUR_SPO1'
START_COLUMN = 25
START_ROW = 6
importing
answer = answer
exception
TEXT_NOT_FOUND = 1
others = 2.
Regards
Ashish Jain -
Userdefined F1 help for FM Popup_to_confirm
Hi All,
I need to create userdefined_f1_help for the function Popup_to_confirm.
Pls tell me how to create customized Z help which I can pass as value to parameter userdefined_f1_help to this FM.
RishiYou need to create a document in transaction SE61 and pass the name of the document created to function POPUP_TO_CONFIRM in parameter USERDEFINED_F1_HELP.
~ -
Looking for some assistancte in GUI_DOWNLOAD
Hi there,
See I have this exercise I have to do here. Basically I have to create a program that will download the contects of SBOOK to my pc. I have to use GUI_DOWNLOAD in this exercise. Also, the user will have to input the path and file name of the file to be downloaded to. I have place appropriate error message on the screen as well but I'm not sure how to do this.Being relatively new to this, I tried looking for some samples and this is what I came up so far.
REPORT ZISTANZS_TRNG_EX9C.
TABLES: SBOOK.
PARAMETERS: FILEINP(30) DEFAULT 'c:\TEMP\wee.txt' OBLIGATORY.
DATA: BEGIN OF ITAB OCCURS 100.
INCLUDE STRUCTURE SBOOK.
DATA: END OF ITAB.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = FILEINP
FILETYPE = 'ASC'
write_field_separator = 'X'
TABLES
DATA_TAB = ITAB
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
OTHERS = 3.
Unfortunately, it doesn't work though. It keeps saying that my FILENAME is not the same data type as FILEINP? I'm asking for some assistance in how this can be properly solved? Any help would be appreciated /Hi,
Please refer the code below:
* File download, uses older techniques but achieves a perfectly
* acceptable solution which also allows the user to append data to
* an existing file.
PARAMETERS: p_file like rlgrap-filename.
* Internal table to store export data
DATA: begin of it_excelfile occurs 0,
row(500) type c,
end of it_excelfile.
DATA: rc TYPE sy-ucomm,
ld_answer TYPE c.
CALL FUNCTION 'WS_QUERY'
EXPORTING
query = 'FE' "File Exist?
filename = p_file
IMPORTING
return = rc.
IF rc NE 0. "If File alread exists
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
* TITLEBAR = ' '
* DIAGNOSE_OBJECT = ' '
text_question = 'File Already exists!!'
text_button_1 = 'Replace'
* ICON_BUTTON_1 = ' '
text_button_2 = 'New name'
* ICON_BUTTON_2 = ' '
* DEFAULT_BUTTON = '1'
* DISPLAY_CANCEL_BUTTON = 'X'
* USERDEFINED_F1_HELP = ' '
* START_COLUMN = 25
* START_ROW = 6
* POPUP_TYPE =
IMPORTING
answer = ld_answer
* TABLES
* PARAMETER =
EXCEPTIONS
text_not_found = 1
OTHERS = 2.
* Option 1: Overwrite
IF ld_answer EQ '1'.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
filename = p_file "File Name
filetype = 'ASC'
* IMPORTING
* FILELENGTH =
TABLES
data_tab = it_excelfile "Data table
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE i003(zp) WITH
'There was an error during Excel file creation'(200).
exit. "Causes short dump if removed and excel document was open
ENDIF.
* Option 2: New name.
ELSEIF ld_answer EQ '2'.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
filename = p_file "File name
filetype = 'ASC' "File type
* col_select = 'X' "COL_SELECT
* col_selectmask = 'XXXXXXXXXXXXXXXXXXXXXXXXXX'
* "COL_SELECTMASK
filetype_no_show = 'X' "Show file type selection?
* IMPORTING
* act_filename = filename_dat
TABLES
data_tab = it_excelfile "Data table
* fieldnames =
EXCEPTIONS
file_open_error = 01
file_write_error = 02
invalid_filesize = 03
invalid_table_width = 04
invalid_type = 05
no_batch = 06
unknown_error = 07.
ENDIF.
ELSE. "File does not alread exist.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
filename = p_file "File name
filetype = 'ASC' "File type
* IMPORTING
* FILELENGTH =
TABLES
data_tab = it_excelfile "Data table
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE i003(zp) WITH
'There was an error during Excel file creation'(200).
exit. "Causes short dump if removed and excel document was open
ENDIF.
ENDIF.
Thanks,
Sriram Ponna. -
Check box in ALV grid gets unselected for new selection
Hi all,
This is my code :
TYPE-POOLS : slis.
Variable
DATA: g_repid LIKE sy-repid,
g_title TYPE lvc_title,
g_set_pf_stat TYPE slis_formname VALUE 'SET_PF_STATUS',
g_user_command TYPE slis_formname VALUE 'USER_COMMAND',
g_layout TYPE slis_layout_alv,
g_print_alv TYPE slis_print_alv,
g_variant LIKE disvariant,
c_char_a(1) VALUE 'A',
c_char_x(1) VALUE 'X',
itab_alv_sort TYPE slis_t_sortinfo_alv,
itab_alv_fcat TYPE slis_t_fieldcat_alv,
fm_name type rs38l_fnam," Function Module Name
* l_sfctrlparams LIKE ssfctrlop, " Form Print Parameter
* l_sfoutopt LIKE ssfcompop,
pri_params LIKE pri_params,
c_x type c .
* Internal tables Begin with IT_ *
DATA : it_fcat TYPE SLIS_T_FIELDCAT_ALV, "---ALV
it_disp type table of ZLOI.
* Work Area for Internal tables Begin with WA_ *
data : wa_fcat TYPE slis_fieldcat_alv , "---ALV
wa_layout TYPE lvc_s_layo, "---ALV
wa_it_disp like line of it_disp.
* Objects *
DATA : cref TYPE REF TO cl_gui_custom_container, "---ALV
gref TYPE REF TO cl_gui_alv_grid. "---ALV
* Start-of-selection
Start-of-selection.
perform fetch_po_det.
perform build_fcat.
perform alv_display.
*& Form FETCH_PO_DET
* text
* --> p1 text
* <-- p2 text
FORM FETCH_PO_DET .
data : it_po type table of crmd_orderadm_h,
wa_po like line of it_po,
wa_header type BBP_PDS_PO_HEADER_D.
select guid
object_id
DESCRIPTION
POSTING_DATE
CREATED_BY
from crmd_orderadm_h
into corresponding fields of table it_po
where object_type = 'BUS2201'.
loop at it_po into wa_po.
move wa_po-object_id to wa_it_disp-ZZPONO.
move wa_po-DESCRIPTION to wa_it_disp-ZZPODESC.
move wa_po-posting_date to wa_it_disp-ZZPODATE.
move wa_po-created_by to wa_it_disp-ZZPOCREATOR.
CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
EXPORTING
I_OBJECT_ID = wa_it_disp-zzpono
IMPORTING
E_HEADER = wa_header.
move wa_header-total_value to wa_it_disp-ZZPOVAL.
move wa_header-currency to wa_it_disp-ZZPOCUR.
append wa_it_disp to it_disp.
endloop.
* write : wa_it_disp-zzpono.
ENDFORM. " FETCH_PO_DET
*& Form BUILD_FCAT
* text
* --> p1 text
* <-- p2 text
FORM BUILD_FCAT .
g_repid = sy-repid.
g_title = 'LOI details'.
g_print_alv-no_print_listinfos = 'X'.
g_variant-report = sy-repid.
g_variant-variant = sy-title.
CLEAR g_layout.
g_layout-f2code = ' '.
wa_layout-zebra = 'X'.
g_layout-flexible_key = 'X'.
g_layout-colwidth_optimize = 'X'.
g_layout-detail_initial_lines = 'X'.
g_layout-box_fieldname = 'ZZCHECK'.
*g_layout-box_tabname = 'ITAB_REPORT'.
*Check box
wa_fcat-fieldname = 'ZZCHECK'.
wa_fcat-checkbox = 'X'.
wa_fcat-outputlen = '1'.
wa_fcat-col_pos = '1'.
wa_fcat-edit = '1'.
wa_fcat-seltext_m = 'No'.
append wa_fcat to it_fcat.
*Po no
clear wa_fcat.
wa_fcat-fieldname = 'ZZPONO' .
wa_fcat-tabname = 'IT_DISP'.
* wa_fcat-seltext = 'Purchase Order'.
wa_fcat-seltext_m = 'Purchase Order'.
*wa_fcat-seltext_s = 'Purchase Order.
wa_fcat-icon = 'X'.
wa_fcat-col_pos = '2'.
wa_fcat-outputlen = 10.
append wa_fcat to it_fcat.
*Desc
wa_fcat-fieldname = 'ZZPODESC' .
wa_fcat-tabname = 'IT_DISP'.
*wa_fcat-seltext_l = 'Description'.
wa_fcat-seltext_m = 'Description'.
*wa_fcat-seltext_s = 'Description'.
wa_fcat-col_pos = '3'.
wa_fcat-outputlen = 10.
append wa_fcat to it_fcat.
*Postign date
wa_fcat-fieldname = 'ZZPODATE' .
wa_fcat-tabname = 'IT_DISP'.
wa_fcat-seltext_l = 'Posting Date'.
wa_fcat-seltext_m = 'Posting Date'.
*wa_fcat-seltext_s = 'Posting Date'.
wa_fcat-col_pos = '4'.
wa_fcat-outputlen = 8.
append wa_fcat to it_fcat.
*value
wa_fcat-fieldname = 'ZZPOVAL' .
wa_fcat-tabname = 'IT_DISP'.
*wa_fcat-seltext_l = 'PO value'.
wa_fcat-seltext_m = 'PO value'.
*wa_fcat-seltext_s = 'PO value'.
wa_fcat-col_pos = '5'.
wa_fcat-outputlen = 15.
append wa_fcat to it_fcat.
*Currency
wa_fcat-fieldname = 'ZZPOCUR' .
wa_fcat-tabname = 'IT_DISP'.
*wa_fcat-seltext_l = 'PO Currency'.
wa_fcat-seltext_m = 'PO Currency'.
*wa_fcat-seltext_s = 'PO Currency'.
wa_fcat-col_pos = '6'.
wa_fcat-outputlen = 5.
append wa_fcat to it_fcat.
*Creator
wa_fcat-fieldname = 'ZZPOCREATOR' .
wa_fcat-tabname = 'IT_DISP'.
*wa_fcat-seltext_l = 'Buyer'.
wa_fcat-seltext_m = 'Buyer'.
*wa_fcat-seltext_s = 'Buyer'.
wa_fcat-col_pos = '7'.
wa_fcat-outputlen = 12.
append wa_fcat to it_fcat.
ENDFORM. " BUILD_FCAT
*& Form ALV_DISPLAY
* text
* --> p1 text
* <-- p2 text
FORM ALV_DISPLAY .
sort it_disp by ZZPONO.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = g_repid
I_CALLBACK_PF_STATUS_SET = g_set_pf_stat
I_CALLBACK_USER_COMMAND = g_user_command
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
I_GRID_TITLE = g_title
* I_GRID_SETTINGS =
IS_LAYOUT = g_layout
IT_FIELDCAT = it_fcat[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
IS_VARIANT = g_variant
* IT_EVENTS =
* IT_EVENT_EXIT =
IS_PRINT = g_print_alv
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = it_disp[]
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " ALV_DISPLAY
*& Form user_command
* text
* -->R_UCOMM text
* -->RS_SELFIELD text
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield. "#EC CALLED
CASE R_UCOMM.
WHEN 'PRINT'.
READ TABLE IT_disp INTO WA_IT_DISP WITH KEY ZZCHECK = 'X'.
IF SY-SUBRC EQ 0.
loop at it_DISP INTO WA_IT_DISP.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TEXT_QUESTION = 'Print the LOI details?'
TEXT_BUTTON_1 = 'Yes'
TEXT_BUTTON_2 = 'No'.
* IMPORTING
* ANSWER = w_answer.
IF SY-SUBRC 0.
ENDIF.
* PERFORM CALL_SF.
endloop.
ENDIF.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
LEAVE PROGRAM.
ENDCASE.
rs_selfield-refresh = 'X'.
ENDFORM. "user_command
*& Form set_pf_status
* text
* -->RT_EXTAB text
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZSTANDARD' EXCLUDING rt_extab.
SET TITLEBAR sy-tcode.
ENDFORM. "set_pf_status
Now in my ALV grid o/p i can see the check box but if i select one row and then try to slect another the first one gets deselected.
Can anybody tell me what is missing?Hi,
if you need just a check box for each line, try to get rid of this line from your layout.
g_layout-box_fieldname = 'ZZCHECK'.
SAP uses this field to store info about selected lines. Hence you click on the second check box, you select different line and the first line is erased. You can select more line by holding SHIFT + CTRL
Cheers -
How to do advance payment against PO for this is there any T.code
Hello,
Lt's say for ex: Once Po is created how to pay the advance payment against PO to the vendor, for that is there any transaction code.
Once advance payment is made against PO, again system should not allow for ammendement
So like this to control the system what are the configuration settings need to be done please explain
Early action in this matter will be highly appreciated.Hi,
Apply the user exit : EXIT_SAPMM06E_016
Following Logic can be use:
1. Validate the company code (BUKRS ) & Purchasing document type (BSTYP = F) from EKKO table for the Purchase order number (EBELN).
2. Check the entries for the Purchase order and the item number in the Purchase order history table ( EKBE) and also Validate if there is any down payment document exists (VGABE = 4)
3. If we find down payment doc in EKBE table then display the warning or error message as POP - UP by using functional module POPUP_TO_CONFIRM.
Step 1: Validate Company code and Purchasing Document type from EKKO table
Step 2: Check the Purchasing document history from EKBE table
Step 3: Check whether any down payment exists.
Step 4: Display popup message to user:
Use the function module u201CPOPUP_TO_CONFIRMu201D to display the below message u201CPo cannot be changed, Down payment already exists for this PO item u201D.
Edited by: redriver on Nov 27, 2011 10:06 AM -
F4 for Editable field in ALV, display Name but capture ID
Hi Friends,
I have a ALV for which i have defined a Structure, which is passed to Fieldcatlog.
I have defined a Search help - ZUSER_NAME which has following fields to display.
USERID - USR02-BNAME
FNAME
LNAME
FULLNAME
So my structure for fieldcatalog has User-id which is linked to this search help with Domain XUBNAME.
So in my report i made this User-Id as editable and F4 available, everything is working fine.
when user does a F4, its displaying Userid,Fname,Lname and complete name.upon selection and save i am capturing the id and storing in the ztable.
But now i have a requirement that when user selects a value from this search help on F4, i need to display Fullname but capture the User Id. How can i do that?
This is something similar to the one we have in BSP- key-value pair.
how to do this in ALV.
Appreciate if someone can guide me thru.
Thanks,
Simha
Edited by: Simha on Sep 6, 2008 2:24 PMhai , this is example code for editing the F4 display .. check out this
REPORT zalv_editf4display.
*Type pools for alv
TYPE-POOLS : slis.
*structure for t582a tbale
TYPES : BEGIN OF ty_table,
infty TYPE infty,
pnnnn TYPE pnnnn_d,
zrmkz TYPE dzrmkz,
zeitb TYPE dzeitb,
dname TYPE dianm,
davo TYPE davo,
davoe TYPE davoe,
END OF ty_table.
*Structure for infotype text
TYPES : BEGIN OF ty_itext,
infty TYPE infty,
itext TYPE intxt,
sprsl TYPE sprsl,
END OF ty_itext.
*Structure for output display
TYPES : BEGIN OF ty_output,
infty TYPE infty,
itext TYPE intxt,
pnnnn TYPE pnnnn_d,
zrmkz TYPE dzrmkz,
zeitb TYPE dzeitb,
dname TYPE dianm,
davo TYPE davo,
davoe TYPE davoe,
END OF ty_output.
*internal table and work area declarations
DATA : it_table TYPE STANDARD TABLE OF ty_table INITIAL SIZE 0,
it_output TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
it_pbo TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
it_ittext TYPE STANDARD TABLE OF ty_itext INITIAL SIZE 0,
wa_table TYPE ty_table,
wa_output TYPE ty_output,
wa_ittext TYPE ty_itext.
*Data declarations for dropdown lists for f4
DATA: it_dropdown TYPE lvc_t_drop,
ty_dropdown TYPE lvc_s_drop,
*data declaration for refreshing of alv
stable TYPE lvc_s_stbl.
*Global variable declaration
DATA: gstring TYPE c.
*Data declarations for ALV
DATA: c_ccont TYPE REF TO cl_gui_custom_container, "Custom container object
c_alvgd TYPE REF TO cl_gui_alv_grid, "ALV grid object
it_fcat TYPE lvc_t_fcat, "Field catalogue
it_layout TYPE lvc_s_layo. "Layout
*ok code declaration
DATA:
ok_code TYPE ui_func.
*initialization event
INITIALIZATION.
*start of selection event
START-OF-SELECTION.
*select the infotypes maintained
SELECT infty
pnnnn
zrmkz
zeitb
dname
davo
davoe
FROM t582a UP TO 10 ROWS
INTO CORRESPONDING FIELDS OF TABLE it_table.
*Select the infotype texts
IF it_table[] IS NOT INITIAL.
SELECT itext
infty
sprsl
FROM t582s
INTO CORRESPONDING FIELDS OF TABLE it_ittext
FOR ALL ENTRIES IN it_table
WHERE infty = it_table-infty
AND sprsl = 'E'.
ENDIF.
*Apppending the data to the internal table of ALV output
LOOP AT it_table INTO wa_table.
wa_output-infty = wa_table-infty.
wa_output-pnnnn = wa_table-pnnnn.
wa_output-zrmkz = wa_table-zrmkz.
wa_output-zeitb = wa_table-zeitb.
wa_output-dname = wa_table-dname.
wa_output-davo = wa_table-davo.
wa_output-davoe = wa_table-davoe.
For texts
READ TABLE it_ittext INTO wa_ittext WITH KEY infty = wa_table-infty.
wa_output-itext = wa_ittext-itext.
APPEND wa_output TO it_output.
CLEAR wa_output.
ENDLOOP.
Calling the ALV screen with custom container
CALL SCREEN 0600.
*On this statement double click it takes you to the screen painter SE51.
*Enter the attributes
*Create a Custom container and name it CCONT and OK code as OK_CODE.
*Save check and Activate the screen painter.
*Now a normal screen with number 600 is created which holds the ALV grid.
PBO of the actual screen ,
Here we can give a title and customized menus
*create 2 buttons with function code 'SAVE' and 'EXIT'.
GIVE A SUITABLE TITLE
*& Module STATUS_0600 OUTPUT
text
MODULE status_0600 OUTPUT.
SET PF-STATUS 'DISP'.
SET TITLEBAR 'ALVF4'.
ENDMODULE. " STATUS_0600 OUTPUT
calling the PBO module ALV_GRID.
*& Module PBO OUTPUT
text
MODULE pbo OUTPUT.
*Creating objects of the container
CREATE OBJECT c_ccont
EXPORTING
container_name = 'CCONT'.
create object for alv grid
create object c_alvgd
exporting
i_parent = c_ccont.
SET field for ALV
PERFORM alv_build_fieldcat.
Set ALV attributes FOR LAYOUT
PERFORM alv_report_layout.
CHECK NOT c_alvgd IS INITIAL.
Call ALV GRID
CALL METHOD c_alvgd->set_table_for_first_display
EXPORTING
is_layout = it_layout
i_save = 'A'
CHANGING
it_outtab = it_output
it_fieldcatalog = it_fcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDMODULE. " PBO OUTPUT
*& Form alv_build_fieldcat
text
<--P_IT_FCAT text
*subroutine to build fieldcat
FORM alv_build_fieldcat.
DATA lv_fldcat TYPE lvc_s_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '1'.
lv_fldcat-fieldname = 'INFTY'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 8.
lv_fldcat-scrtext_m = 'Infotype'.
lv_fldcat-icon = 'X'.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '2'.
lv_fldcat-fieldname = 'PNNNN'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'Structure'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '3'.
lv_fldcat-fieldname = 'ITEXT'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 60.
lv_fldcat-scrtext_m = 'Description'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '5'.
lv_fldcat-fieldname = 'ZRMKZ'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 1.
lv_fldcat-scrtext_m = 'PERIOD'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '6'.
lv_fldcat-fieldname = 'ZEITB'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 5.
lv_fldcat-scrtext_m = 'Time constraint'.
lv_fldcat-edit = 'X'.
*To avail the existing F4 help these are to
*be given in the field catalogue
lv_fldcat-f4availabl = 'X'.
lv_fldcat-ref_table = 'T582A'.
lv_fldcat-ref_field = 'ZEITB'.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '7'.
lv_fldcat-fieldname = 'DNAME'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'Dialogmodule'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '8'.
lv_fldcat-fieldname = 'DAVO'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'Start'.
lv_fldcat-edit = 'X'.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos = '1'.
lv_fldcat-col_pos = '9'.
lv_fldcat-fieldname = 'DAVOE'.
lv_fldcat-tabname = 'IT_OUTPUT'.
lv_fldcat-outputlen = 15.
lv_fldcat-scrtext_m = 'End'.
lv_fldcat-icon = ''.
APPEND lv_fldcat TO it_fcat.
CLEAR lv_fldcat.
*To create drop down for the field 'DAVO'
with our own f4 help
ty_dropdown-handle = '1'.
ty_dropdown-value = ' '.
APPEND ty_dropdown TO it_dropdown.
ty_dropdown-handle = '1'.
ty_dropdown-value = '1'.
APPEND ty_dropdown TO it_dropdown.
ty_dropdown-handle = '1'.
ty_dropdown-value = '2'.
APPEND ty_dropdown TO it_dropdown.
ty_dropdown-handle = '1'.
ty_dropdown-value = '3'.
APPEND ty_dropdown TO it_dropdown.
CALL METHOD c_alvgd->set_drop_down_table
EXPORTING
it_drop_down = it_dropdown.
LOOP AT it_fcat INTO lv_fldcat.
CASE lv_fldcat-fieldname.
To assign dropdown in the fieldcataogue
WHEN 'DAVO'.
lv_fldcat-drdn_hndl = '1'.
lv_fldcat-outputlen = 15.
MODIFY it_fcat FROM lv_fldcat.
ENDCASE.
ENDLOOP.
ENDFORM. " alv_build_fieldcat
*& Form alv_report_layout
text
<--P_IT_LAYOUT text
*Subroutine for setting alv layout
FORM alv_report_layout.
it_layout-cwidth_opt = 'X'.
it_layout-col_opt = 'X'.
it_layout-zebra = 'X'.
ENDFORM. " alv_report_layout
PAI module of the screen created. In case we use an interactive ALV or
*for additional functionalities we can create OK codes
*and based on the user command we can do the coding.
*& Module PAI INPUT
text
MODULE pai INPUT.
*To change the existing values and refresh the grid
*And only values in the dropdown or in the default
*F4 can be given , else no action takes place for the dropdown
*and error is thrown for the default F4 help and font changes to red
*and on still saving, value is not changed
c_alvgd->check_changed_data( ).
*Based on the user input
*When user clicks 'SAVE;
CASE ok_code.
WHEN 'SAVE'.
*A pop up is called to confirm the saving of changed data
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'SAVING DATA'
text_question = 'Continue?'
icon_button_1 = 'icon_booking_ok'
IMPORTING
answer = gstring
EXCEPTIONS
text_not_found = 1
OTHERS = 2.
IF sy-subrc NE 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*When the User clicks 'YES'
IF ( gstring = '1' ).
MESSAGE 'Saved' TYPE 'S'.
*Now the changed data is stored in the it_pbo internal table
it_pbo = it_output.
*Subroutine to display the ALV with changed data.
PERFORM redisplay.
ELSE.
*When user clicks NO or Cancel
MESSAGE 'Not Saved' TYPE 'S'.
ENDIF.
**When the user clicks the 'EXIT; he is out
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
CLEAR: ok_code.
ENDMODULE. " PAI INPUT
*& Form REDISPLAY
text
--> p1 text
<-- p2 text
FORM redisplay .
*Cells of the alv are made non editable after entering OK to save
CALL METHOD c_alvgd->set_ready_for_input
EXPORTING
i_ready_for_input = 0.
*Row and column of the alv are refreshed after changing values
stable-row = 'X'.
stable-col = 'X'.
*REfreshed ALV display with the changed values
*This ALV is non editable and contains new values
CALL METHOD c_alvgd->refresh_table_display
EXPORTING
is_stable = stable
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " REDISPLAY -
DYNPRO_SEND_IN_BACKGROUND SAPLSPO1 or LSPO1U06 POPUP_TO_CONFIRM
Hi
Request you all to go through the dump,
|What happened?
|
|
Error in the ABAP Application Program
|
|
|
|
The current ABAP program "SAPLSPO1" had to be terminated because it has
|
|
come across a statement that unfortunately cannot be executed.
|
|What can you do?
|
|
Note down which actions and inputs caused the error.
|
|
|
|
|
|
To process the problem further, contact you SAP system
|
|
administrator.
|
|
|
|
Using Transaction ST22 for ABAP Dump Analysis, you can look
|
|
at and manage termination messages, and you can also
|
|
keep them for a long time.
|
|Error analysis
|
|
During background processing, the system attempted to send a screen to a
|
|
user.
|
|
|
|
Current screen: "SAPLSPO1 " 0500.
|
|
|
|
Additional system information:
|
|
"currently running as cpic server"
|
|
|
|How to correct the error
|
|
If the error occurred in your own ABAP program or in an SAP
|
|
program you modified, try to remove the error.
|
|
|
|
|
|
If the error occures in a non-modified SAP program, you may be able to
|
|
find an interim solution in an SAP Note.
|
|
If you have access to SAP Notes, carry out a search with the following
|
|
keywords:
|
|
|
|
"DYNPRO_SEND_IN_BACKGROUND" " "
|
|
"SAPLSPO1" or "LSPO1U06"
|
|
"POPUP_TO_CONFIRM"
|
|
|
|
If you cannot solve the problem yourself and want to send an error
|
|
notification to SAP, include the following information:
|
|
|
|
1. The description of the current problem (short dump)
|
|
|
|
To save the description, choose "System->List->Save->Local File
|
|
(Unconverted)".
|
|
|
|
2. Corresponding system log
|
|
|
|
Display the system log by calling transaction SM21.
|
|
Restrict the time interval to 10 minutes before and five minutes
|
|
after the short dump. Then choose "System->List->Save->Local File
|
|
(Unconverted)".
|
|
|
|
3. If the problem occurs in a problem of your own or a modified SAP
|
|
program: The source code of the program
|
|
In the editor, choose "Utilities->More
|
|
Utilities->Upload/Download->Download".
|
|
|
|
4. Details about the conditions under which the error occurred or which
|
|
actions and input led to the error.
|
|
|
|System environment
|
|
SAP Release..... 731
|
|
SAP Basis Level. 0005
|
|
|
|
Application server... "lecc-prd-10"
|
|
Network address...... "172.18.218.141"
|
|
Operating system..... "Linux"
|
|
Release.............. "2.6.32-220.2.1.el6.x"
|
|
Hardware type........ "x86_64"
|
|
Character length.... 16 Bits
|
|
Pointer length....... 64 Bits
|
|
Work process number.. 8
|
|
Shortdump setting.... "full"
|
|
|
|
Database server... "lsdb-prd-2"
|
|
Database type..... "ORACLE"
|
|
Database name..... "EP1"
|
|
Database user ID.. "SAPSR3"
|
|
|
|
Terminal.......... " "
|
|
|
|
Char.set.... "C"
|
|
|
|
SAP kernel....... 720
|
|
created (date)... "Jan 15 2013 18:18:58"
|
|
create on........ "Linux GNU SLES-11 x86_64 cc4.3.4 use-pr121116"
|
|
Database version. "OCI_112, 11.2.0.3.0, V1, default"
|
|
|
|
Patch level. 401
|
|
Patch text.. " "
|
|
|
|
Database............. "ORACLE 10.1.0.*.*, ORACLE 10.2.0.*.*, ORACLE 11.2.*.*.*"
|
|
SAP database version. 720
|
|
Operating system..... "Linux 2.6, Linux 3"
|
|
|
|
Memory consumption
|
|
Roll.... 0
|
|
EM...... 12569424
|
|
Heap.... 0
|
|
Page.... 16384
|
|
MM Used. 10030984
|
|
MM Free. 2535400
|
|User and Transaction
|
|
Client.............. 100
|
|
User................ "EWMONECC"
|
|
Language key........ "E"
|
|
Transaction......... " "
|
|
Transaction ID...... "530F7949A5601689E1000000AC12DA41"
|
|
|
|
EPP Whole Context ID.... "005056B976AF1ED3A8902D8CE1BD4303"
|
|
EPP Connection ID....... "53109D4E863D7FBCE1000000AC12DA42"
|
|
EPP Caller Counter...... 1
|
|
|
|
Program............. "SAPLSPO1"
|
|
Screen.............. "SAPMSSY1 3004"
|
|
Screen Line......... 2
|
|
Debugger Active..... "none"
|
|Server-Side Connection Information
|
|
Information on caller of Remote Function Call (RFC):
|
|
System.............. "EP1"
|
|
Installation Number. 0020694200
|
|
Database Release.... 731
|
|
Kernel Release...... 720
|
|
Connection Type..... 3 (2=R/2, 3=ABAP System, E=Ext., R=Reg. Ext.)
|
|
Call Type........... "synchronous and transactional type Q (emode 0, imode 0)"
|
|
Inbound TID.........."AC12DA8A728B531098C05738"
|
|
Inbound Queue Name..."DLWSWP1CLNT1008000001383"
|
|
Outbound TID........." "
|
|
Outbound Queue Name.." "
|
|
|
|
Client.............. 100
|
|
User................ "EWMONECC"
|
|
Transaction......... " "
|
|
Call Program........."SAPLIRFC"
|
|
Function Module..... "TRFC_QIN_DEST_SHIP"
|
|
Call Destination.... "lecc-prd-10_EP1_00"
|
|
Source Server....... "lecc-prd-10_EP1_00"
|
|
Source IP Address... "172.18.218.141"
|
|
|
|
Additional information on RFC logon:
|
|
Trusted Relationship " "
|
|
Logon Return Code... 0
|
|
Trusted Return Code. 0
|
|
|
|
Note:
|
|
- For Releases < 4.0, information on the RFC caller not available.
|
|
- The installation number is available from caller Release > 700
|
|
|
|
Additional information on RFC logon:
|
|
Trusted Relationship " "
|
|
Logon Return Code... 0
|
|
Trusted Return Code. 0
|
|
|
|
Note: For releases < 4.0, information on the RFC caller are often
|
|
only partially available.
|
|Information on where terminated
|
|
Termination occurred in the ABAP program "SAPLSPO1" - in "POPUP_TO_CONFIRM".
|
|
The main program was "SAPMSSY1 ".
|
|
|
|
In the source code you have the termination point in line 248
|
|
of the (Include) program "LSPO1U06".
|
|Source Code Extract
|
|Line |SourceCde
|
| 218|
PERFORM append_icon_to_button
|
| 219|
USING
icon_button_4
|
| 220|
l_quickinfo_button_4
"*048i
|
| 221|
CHANGING button_4.
|
| 222| ENDIF.
"974439 <<
|
| 223|
|
| 224|
|
| 225|* Aufbereitung des Fragetextes und Berechnung der Dynprogröße
|
| 226| PERFORM format_text TABLES text_tab1
|
| 227|
USING fragetext.
|
| 228|
|
| 229| PERFORM calculate_screen_size
|
| 230|
USING
|
| 231|
textlength
|
| 232|
start_spalte
|
| 233|
start_zeile
|
| 234|
CHANGING
|
| 235|
tab_len1
|
| 236|
tab_len2
|
| 237|
end_spalte
|
| 238|
end_zeile
|
| 239|
dynpro_nummer.
|
| 240|
|
| 241|
|
| 242|* Aufruf der Dialog-Dynpros
|
| 243|
|
| 244| CALL SCREEN dynpro_nummer STARTING AT start_spalte start_zeile
|
| 245|
ENDING AT end_spalte end_zeile.
|
| 246|
|
| 247|
|
|>>>>>| answer = antwort.
|
| 249|ENDFUNCTION.
|Hi Madan,
I'm suggesting you for SAP Note 1265724 - BAPI technically close PO: Dump DYNPRO_SEND_IN_BACKGROUND
1739959 - DYNPRO_SEND_IN_BACKGROUND
Try to update kernel patch with the latest one available.
Need more info regarding which program or report you are executing .
Thanks,
Gaurav -
Preparing for upgrade and Unicode conversion while on 4.6c
We're currently on 4.6c and preparing to upgrade to ERP 2005 and do a Unicode conversion. I'm trying to compile a list of coding techniques that can used in 4.6c that will minimize changes needed for Unicode. Does anyone have such a list?
Some things I've discovered reading about Unicode include:
1) Use GUI_UPLOAD and GUI_DOWNLOAD rather than WS_UPLOAD and WS_DOWNLOAD.
2) Structures or table headers that contain non-character data need to be identical when moving, comparing, selecting into, updating from, etc. This includes not moving structures/tables with non-character data to a character field or vice-versa.
3) Offsets can't cross non-character data.
4) Assign statement with offset must specify a length.
5) Open dataset must specify "FOR INPUT", "FOR OUTPUT", "FOR APPENDING", or "FOR UPDATE". It no longer defaults to FOR INPUT when omitted.
6) Many implicit conversions from char to numeric are no longer allowed. Use explicit conversion instead; such as the move statement.
I know there are others. Any help would be appreciated.
Regards,
Mark PerreyHai Mark
Check the following F.M Replacents
Upgrade Error Details Suggestions
Function Module "DOCUMENT_REGISTRY_PROGRAM"not found in the target system Suggest to replace this FM with the function module CV120_GET_APPL_FROM_REGISTRY.
Function Module "RP_HIRE+FIRE"not found in the target system Suggest to replace this FM with the function module RP_HIRE_FIRE .
Function Module "ME_READ_HEADER_SINGLE" not found in the target system Suggest to replace this FM with the function module ME_EKKO_SINGLE_READ.
Function Module "ME_READ_ITEM_SINGLE" not found in the target system Suggest to replace this FM with the function module ME_EKPO_SINGLE_READ.
Function Module "RZL_ALERT_CONTROL" not found in the target system Function Module "RZL_ALERT_CONTROL" is not available in the Enterprise Version. Suggest to use the function module "TH_SEND_ADM_MESS" to acheive the same functionality of "RZL_ALERT_CONTROL".
Function Module "MM_SELECT_ADDRESS" not found in the target system Suggest to replace this FM with the function module MM_SELECT_PARTNER.
Function Module "MM_READ_ADDRESS" not found in the target system Suggest to replace this FM with the function module MM_PARTNERS_FOR_MESSAGING
Function Module "ME_VALUES_T161" not found in the target system Suggest to replace this FM with the function module HELP_VALUES_BSART.
Function Module "ME_VALUES_T024W" not found in the target system . Suggest to replace this FM with the function module HELP_VALUES_WERKS.
Function Module "SD_PACKING_REFRESH" not found in the target system Suggest to replace this FM with the function module HU_PACKING_REFRESH.
Function Module "SD_PACKING_RENAME" not found in the target system Suggest to replace this FM with the function module V51P_PACKING_RENAME.
Function Module "RV_EXPORT_CONTROL_UPDATE" not found in the target system Suggest to replace this FM with the function module RV_EXPORT_CONTROL_UPD_PREPARE.
Function Module "RV_INVOICE_COPY" not found in the target system Suggest to replace this FM with the function module RV_SALES_DOCUMENT_COPY.
Function Module "SD_SCHEDULE_AGREEMENT_PACKING" not found in the target system Suggest to replace this FM with the function module HU_PACKING_SALES_PROPOSAL.
Function Module "SERIAL_RENUM_WV" not found in the target system Suggest to replace this FM with the function module IWOL_WV_SWITCH_NUMBER.
Function Module "CUD0_DISPLAY_CONFIGURATION" not found in the target system Suggest to replace this FM with the function module VC_I_DISPLAY_CONFIGURATION.
Function Module "SD_PACKING_CREATE" not found in the target system Suggest to replace this FM with the function module V51F_PACKING_CREATE.
Function Module "FI_ARCHIVE_CHECK_DOC" not found in the target system Function Module FI_ARCHIVE_CHECK_DOC is not available in the Enterprise Version. Suggest to replace this FM with the function module FI_DOCUMENT_ARCH_CHECK_DOCS.
Function Module "OPEN_FI_CHECK" not found in the target system Function Module OPEN_FI_CHECK is not available in the Enterprise Version. Suggest to replace this FM with the function module OPEN_FI_PERFORM_******_E.
Function Module "SD_PACKING_UPDATE"not found in the target system Function Module SD_PACKING_UPDATE is not available in the Enterprise Version. Suggest to replace this FM with the function module HU_PACKING_UPDATE.
Function Module "F4_MACO" is being used in the program Function Module "F4_MACO" is not available in the Enterprise Version. Since the Matchcode objects are not used in the Enterprise Version, Suggest to replace this FM with Search help's Value Request function module F4_SEARCH_HELP.
Function Module "SWZ_AI_RELEASE_S" is used in the program Suggest to use the function module "SWZ_AI_RELEASE" instead of "SWZ_AI_RELEASE_S".
Function Module "SWW_WI_ORGTASK_READ" is used in the program Suggest to replace this FM with the function module RH_WI_ORGTASK_READ.
Function Module "RH_READ_EXCEL_PATH" is being used in the program Suggest to replace this FM with "RH_CHECK_EXCEL_SUPPORT".
Function Module "RZL_ALERT_CONTROL" is used in the program Function Module "RZL_ALERT_CONTROL" is not available in the Enterprise Version. Suggest to use the function module "TH_SEND_ADM_MESS" to acheive the same functionality of "RZL_ALERT_CONTROL".
Function Module "CONVERT_TO_OTHER_CURRENCY" is used in the program Suggest to ruse the function module "CONVERT_TO_LOCAL_CURRENCY" for currency conversion.
Function Module "LOAN_TABLECONTROL_SCROLLING" is not available in the Enterprise Version. Suggest to replace this FM with the function module SCROLLING_IN_TABLE.
CALL FUNCTION 'DOWNLOAD' used in program is obsolete in target system. "DOWNLOAD function module is obsolete and result in errors on Unicode systems or on systems that may potentially be Unicode enabled.
Suggest to use the unicode enabled methods
FILE_SAVE_DIALOG and GUI_DOWNLOAD
from class CL_GUI_FRONTEND_SERVICES.
Note:
However, to support existing applications, a compatibility mode was added to the function module(enhanced with Support Package) that will forward calls to DOWNLOAD to the new GUI_DOWNLOAD functions."
CALL FUNCTION 'HELP_VALUES_GET_NO_DD_NAME' used in program is obsolete in target system. "HELP_VALUES_GET_NO_DD_NAME function module is obsolete and result in errors on Unicode systems or on systems that may potentially be Unicode enabled.
Suggest to use the function module F4IF_INT_TABLE_VALUE_REQUEST in the target system."
CALL FUNCTION 'POPUP_TO_CONFIRM_LOSS_OF_DATA' used in program is obsolete in target system. "POPUP_TO_CONFIRM_LOSS_OF_DATA is obsolete in the target system.
Suggest to use function module POPUP_TO_CONFIRM."
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP' used in program is obsolete in target system. "POPUP_TO_CONFIRM_STEP is obsolete in the target system.
Suggest to use function module POPUP_TO_CONFIRM."
CALL FUNCTION 'WS_DOWNLOAD' used in program is obsolete in target system. "WS_DOWNLOAD function module is obsolete and result in errors on Unicode systems or on systems that may potentially be Unicode enabled.
Suggest to use the unicode enabled GUI_DOWNLOAD function module.
Note:
However, to support existing applications, a compatibility mode was added to the function module(enhanced with Support Package) that will forward calls to WS_DOWNLOAD to the new GUI_DOWNLOAD function."
CALL FUNCTION 'WS_FILENAME_GET' used in program is obsolete in target system. "WS_FILENAME_GET function module is obsolete, and results in errors on Unicode systems.
Suggest to use FILE_OPEN_DIALOG und FILE_SAVE_DIALOG Unicode-enabled methods of the cl_gui_frontend_services class.
Note:
New applications should restart on these methods instead of the function module. The function module is extended by a Support Package so that it diverts calls to the methods without the application having to be changed."
CALL FUNCTION 'WS_UPLOAD' used in program is obsolete in target system. "WS_UPLOAD function module is obsolete and result in errors on Unicode systems or on systems that may potentially be Unicode enabled.
Suggest to use the unicode enabled GUI_UPLOAD function module.
Note:
However, to support existing applications, a compatibility mode was added to the function module(enhanced with Support Package) that will forward calls to WS_UPLOAD to the new GUI_UPLOAD function."
Function parameters EBENE, GRUPP, DATE_LOW, DATE_HIGH, BANKK. BUKRS, S_BUKRS, S_DISPW in function module CASH_FORECAST_TR_SELECT_ITEM is missing in the target system. "Function Module CASH_FORECAST_TR_SELECT_ITEM is no longer used, instead it has been split based on the functionalities.
Suggest to use function module
1) CASH_FORECAST_PR_SELECT_ITEM for Payment Arrangements.
2) For TR, WP, DA use function module CASH_FORECAST_TR_ITEM_2.
The IMPORT and TABLES parameters of the above 2 function modules are almost same as CASH_FORECAST_TR_SELECT_ITEM.
The IMPORT parameter BUKRS is not available in the above 2 function modules. Hence suggest to change the coding accordingly."
Import parameter BUKRS in function CASH_FORECAST_LO_SELECT_ITEM is missing in the target system. "Import parameter BUKRS in function CASH_FORECAST_LO_SELECT_ITEM is not available in the target system.
Also the coding in Function Module based on the parameter BUKRS has been removed, instead the TABLES parameter S_BUKRS and S_GSBER has been used.
Suggest to check the coding in the program accordingly.
Import parameter BUKRS in function CASH_FORECAST_RE_SELECT_ITEM is missing in the target system. "Import parameter BUKRS in function CASH_FORECAST_RE_SELECT_ITEM is not available in the target system.
Also the coding in Function Module based on the parameter BUKRS has been removed, instead the TABLES parameter S_BUKRS and S_GSBER(new parameter) has been used.
Suggest to check the coding in the program accordingly.
Function Module HELP_VALUES_GET_WITH_MACO is obsolete in target system Suggest to use F4IF_FIELD_VALUE_REQUEST
Function Module G_OBJECT_GET is obsolete in target system. Suggest to Use G_INTERVAL_GET_NEXT
Function Module READ_COSTCENTER is obsolete in target system Suggest to Use K_COSTCENTER_SELECT_SINGLE
Function Module K_BUSINESS_PROCESS_READ_MULTI is obsolete or not available in target system Suggest to Use K_PROCESSES_SELECT_TAB
G_SET_AVAILABLE Suggest to Use G_SET_GET_INFO
Function Module G_SET_DOUBLE_CHECK is obsolete or not available in target system "DO NOT CALL THIS FUNCTION MODULE
FROM 4.0A VERSION ,THIS PROBLEM WILL NOT OCCUR"
Function Module HELP_VALUES_GET is obsolete or not available in target system Suggest to Use F4IF_FIELD_VALUE_REQUEST
G_SELECT_SET Suggest to Use G_SET_SELECT
Function Module G_SET_AVAILABLE is obsolete or not available in target system Suggest to Use G_SET_GET_INFO
Function Module NAMETAB_GET is obsolete or not available in target system Suggest to Use DDIF_FIELDINFO_GET
Function Module DD_GET_DD03P is obsolete or not available in target system Suggest to Use DDIF_FIELDINFO_GET / DDIF_TABL_GET
CALL FUNCTION 'POPUP_TO_CONFIRM_WITH_MESSAGE' used in program is obsolete in target system. Suggest to use function module POPUP_TO_CONFIRM.
CALL FUNCTION 'POPUP_TO_DECIDE' used in program is obsolete in target system. Suggest to use function module POPUP_TO_CONFIRM.
Function Module HELP_VALUES_GET_WITH_TABLE is obsolete or not available in target system Suggest to Use F4TOOL_F4FUNCTION_BRIDGE
Function Module CLPB_EXPORT is obsolete or not available in target system "Suggest to Use Suggest to use the unicode enabled methods
CLIPBOARD_EXPORT from class CL_GUI_FRONTEND_SERVICES."
Function Module SAP_TO_ISO_MEASURE_UNIT_CODE is obsolete or not available in target system Suggest to Use UNIT_OF_MEASURE_SAP_TO_ISO
Regards
Sreeni -
Hi guys I have written the following program to upload the purchase order data by using BDC call transaction method, now I want to write whatever is in the message table, I mean the errors if there are any and the other required fields. So can you please help me in writing that :
Thanks
Rajeev Gupta
*& Report ZBDC_PURCHASEORDER *
REPORT zbdc_purchaseorder .
Definition of Structures *
DATA: bdctab LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF itab OCCURS 0,
vend_no(10),
ord_typ(2),
date(8),
purch_org(4),
purch_grp(3),
plant(4),
sloc(4),
mat_grp(3),
mat_no(18),
quant(13),
inc_term(3),
inc_inf(28),
END OF itab.
DATA: itab2 LIKE itab OCCURS 0 WITH HEADER LINE.
Definition of Variables *
DATA: v_tabix LIKE syst-tabix,
v_tabix2(2) TYPE n,
v_ekorg LIKE ekko-ekorg,
v_werks LIKE ekpo-werks,
v_lifnr LIKE ekko-lifnr,
v_bednr LIKE ekpo-bednr,
v_index LIKE syst-index,
l1 LIKE syst-tabix,
c_tabix(2),
v_mat_no(18),
v_mat_quant(16).
Definition of Constants *
START-OF-SELECTION *
START-OF-SELECTION.
PERFORM get_data.
PERFORM create_bdcdata.
END-OF-SELECTION.
*& Form get_data
text
--> p1 text
<-- p2 text
FORM get_data .
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = 'C:\Documents and Settings\ekansh\Desktop\purc_order.txt'
filetype = 'DAT'
TABLES
data_tab = itab
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
OTHERS = 9.
itab2[] = itab[].
*write : / itab-vend_no.
ENDFORM. " get_data
*& Form create_bdcdata
text
--> p1 text
<-- p2 text
FORM create_bdcdata .
DESCRIBE TABLE itab LINES l1.
LOOP AT itab.
v_tabix = syst-tabix.
IF v_tabix = 1.
MOVE v_tabix TO v_tabix2.
PERFORM bdc_dynpro USING:
'X' 'SAPMM06E' '0100',
'' 'BDC_OKCODE' '/00',
'' 'EKKO-LIFNR' itab-vend_no,
'' 'RM06E-BSART' itab-ord_typ,
'' 'RM06E-BEDAT' itab-date,
'' 'EKKO-EKORG' itab-purch_org,
'' 'EKKO-EKGRP' itab-purch_grp,
'' 'RM06E-WERKS' itab-plant,
'' 'RM06E-LGORT' itab-sloc,
'' 'RM06E-MATKL' itab-mat_grp.
PERFORM line_bdc_tab.
v_lifnr = itab-vend_no.
v_ekorg = itab-purch_org.
v_werks = itab-plant.
v_bednr = itab-bednr.
ELSE.
IF v_lifnr = itab-vend_no AND
v_ekorg = itab-purch_org AND
v_werks = itab-plant.
v_bednr = itab-bednr.
v_tabix2 = v_tabix2 + 1.
PERFORM line_bdc_tab.
ELSE.
PERFORM bdc_dynpro USING:
'X' 'SAPMM06E' '0100',
'' 'BDC_OKCODE' '/00',
'' 'EKKO-LIFNR' itab-vend_no,
'' 'RM06E-BSART' itab-ord_typ,
'' 'RM06E-BEDAT' itab-date,
'' 'EKKO-EKORG' itab-purch_org,
'' 'EKKO-EKGRP' itab-purch_grp,
'' 'RM06E-WERKS' itab-plant,
'' 'RM06E-LGORT' itab-sloc,
'' 'RM06E-MATKL' itab-mat_grp.
CLEAR v_tabix2.
v_tabix2 = v_tabix2 + 1.
PERFORM line_bdc_tab.
v_lifnr = itab-vend_no.
v_ekorg = itab-purch_org.
v_werks = itab-plant.
v_bednr = itab-bednr.
ENDIF.
ENDIF.
READ TABLE itab2 WITH KEY vend_no = itab-vend_no
purch_org = itab-purch_org
plant = itab-plant.
IF v_tabix = 1.
MOVE syst-tabix TO v_index.
ENDIF.
v_index = v_index + 1.
READ TABLE itab2 INDEX v_index.
IF itab2-vend_no = itab-vend_no AND
itab2-purch_org = itab-purch_org AND
itab2-plant = itab-plant.
IF l1 = v_tabix.
PERFORM call_save.
CALL TRANSACTION 'ME21' USING bdctab
MODE 'A'
UPDATE 'S'
MESSAGES INTO messtab.
CLEAR bdctab.
REFRESH bdctab.
ENDIF.
ELSE.
PERFORM call_save.
CALL TRANSACTION 'ME21' USING bdctab
MODE 'A'
UPDATE 'S'
MESSAGES INTO messtab.
CLEAR bdctab.
REFRESH bdctab.
ENDIF.
ENDLOOP.
ENDFORM. " create_bdcdata
*& Form bdc_dynpro
text
-->P_0120 text
-->P_0121 text
-->P_0122 text
FORM bdc_dynpro USING p1
p2
p3.
IF p1 = 'X'.
bdctab-dynbegin = p1.
bdctab-program = p2.
bdctab-dynpro = p3.
ELSE.
bdctab-fnam = p2.
bdctab-fval = p3.
ENDIF.
APPEND bdctab.
CLEAR bdctab.
ENDFORM. " bdc_dynpro
*& Form line_bdc_tab
text
--> p1 text
<-- p2 text
FORM line_bdc_tab .
PERFORM bdc_dynpro USING:
'X' 'SAPMM06E' '0120',
'' 'BDC_OKCODE' '/00'.
MOVE v_tabix2 TO c_tabix.
CONCATENATE 'EKPO-EMATN(' c_tabix ')' INTO v_mat_no.
CONCATENATE 'EKPO-MENGE(' c_tabix ')' INTO v_mat_quant.
CONDENSE v_mat_no.
CONDENSE v_mat_quant.
PERFORM bdc_dynpro USING:
'' v_mat_no itab-mat_no,
'' v_mat_quant itab-quant.
ENDFORM. " line_bdc_tab
*& Form call_save
text
--> p1 text
<-- p2 text
FORM call_save .
PERFORM bdc_dynpro USING:
'X' 'SAPMM06E' '0120',
'' 'BDC_OKCODE' '=BU',
'X' 'SAPLSPO1' '0300',
'' 'BDC_OKCODE' '=YES'.
ENDFORM. " call_save<b>Overview</b>
loop at itab.
call transaction ......
if sy-subrc <> '0'.
perform error_message.
endif.
endloop.
form error_message.
call funtion 'format_message'. * to write the error message in to the screen
endform.
See the below example code for BDMSGCOLL Structure ...
REPORT znit_bdc_assign
NO STANDARD PAGE HEADING LINE-SIZE 255.
for programs doing a data transfer by creating a batch-input session
and
for programs doing a data transfer by CALL TRANSACTION USING
*******Here SESSION = ' ' and CTU = 'X'
DATA: ctumode LIKE ctu_params-dismode VALUE 'N' ,
cupdate LIKE ctu_params-updmode VALUE 'L' ,
e_group(12), "group name of error-session
e_user(12) , "user for error-session
e_keep VALUE 'X', "'X' = keep session if finished
e_hdate LIKE sy-datum.
DATA: smalllog VALUE ' ' ,
nodata VALUE '/'.
DATA: flag .
DATA DECLARATION *
TYPES: begin of t_result,
matnr(18) , "TYPE RMMG1-MATNR
maktx(40) , "TYPE makt-maktx
bismt(18) , "TYPE mara-bismt
brgew(13) , "TYPE mara-brgew
gewei(3) , "TYPE mara-gewei
message(250), "Message
END OF t_result .
DATA : right TYPE STANDARD TABLE OF t_result ,
wrong TYPE STANDARD TABLE OF t_result ,
wa_result TYPE t_result .
data definition
Batchinputdata of single transaction
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
messages of call transaction
DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
error session opened (' ' or 'X')
DATA: e_group_opened.
message texts
TABLES: t100.
*INITIALIZATION
INITIALIZATION.
MOVE sy-uname TO e_user .
Start new transaction according to parameters *
FORM bdc_transaction USING tcode.
DATA: l_mstring(480).
DATA: l_subrc LIKE sy-subrc.
batch input session
REFRESH messtab.
CALL TRANSACTION tcode USING bdcdata
MODE ctumode
UPDATE cupdate
MESSAGES INTO messtab.
l_subrc = sy-subrc.
IF smalllog <> 'X'.
WRITE: / 'CALL_TRANSACTION', "CH01
tcode, "CH01
'returncode:'(i05), "CH01
l_subrc, "CH01
'RECORD:', "CH01
sy-index. "CH01
LOOP AT messtab.
SELECT SINGLE * FROM t100 WHERE sprsl = messtab-msgspra
AND arbgb = messtab-msgid
AND msgnr = messtab-msgnr.
IF sy-subrc = 0.
l_mstring = t100-text.
IF l_mstring CS '&1'.
REPLACE '&1' WITH messtab-msgv1 INTO l_mstring.
REPLACE '&2' WITH messtab-msgv2 INTO l_mstring.
REPLACE '&3' WITH messtab-msgv3 INTO l_mstring.
REPLACE '&4' WITH messtab-msgv4 INTO l_mstring.
ELSE.
REPLACE '&' WITH messtab-msgv1 INTO l_mstring.
REPLACE '&' WITH messtab-msgv2 INTO l_mstring.
REPLACE '&' WITH messtab-msgv3 INTO l_mstring.
REPLACE '&' WITH messtab-msgv4 INTO l_mstring.
ENDIF.
CONDENSE l_mstring.
WRITE: / messtab-msgtyp, l_mstring(250).
IF messtab-msgtyp = 'S' . "If successfully uploaded CH01
flag = '1' .
ELSE .
flag = '2' . "if not succesfully uploaded CH01
ENDIF.
MOVE l_mstring TO wa_result-message .
ELSE.
WRITE: / messtab.
ENDIF.
ENDLOOP.
SKIP.
Erzeugen fehlermappe ************************************************
IF l_subrc <> 0 AND e_group <> space.
IF e_group_opened = ' '.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = e_group
user = e_user
keep = e_keep
holddate = e_hdate.
e_group_opened = 'X'.
ENDIF.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = tcode
TABLES
dynprotab = bdcdata.
ENDIF.
ENDIF.
REFRESH bdcdata.
ENDFORM.
Start new screen *
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM.
Insert field *
FORM bdc_field USING fnam fval.
IF fval <> nodata.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDIF.
ENDFORM.
*Structure of the internal table in which data has to be uploaded
TYPES: BEGIN OF t_final,
matnr(18) , "TYPE RMMG1-MATNR
maktx(40) , "TYPE makt-maktx
bismt(18) , "TYPE mara-bismt
brgew(13) , "TYPE mara-brgew
gewei(3) , "TYPE mara-gewei
END OF t_final .
DATA: answer , "return value in popup_to_comfirm
count1 TYPE i , "no. of records not succusfully uploaded
count2 TYPE i . "no. of records successfully uploaded
DATA: i_final TYPE STANDARD TABLE OF t_final ,
wa_final TYPE t_final .
PARAMETERS: p_file LIKE rlgrap-filename OBLIGATORY.
stores file name to be uploaded
AT SELECTION SCREEN *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file .
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = ' '
DEF_PATH = ' '
mask = ',.,..'
MODE = ' '
TITLE = ' '
IMPORTING
filename = p_file
RC =
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
START OF SELECTION *
START-OF-SELECTION.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Confirm Pop-UP'
DIAGNOSE_OBJECT = ' '
text_question = 'Would you like to proceed?'
text_button_1 = 'Yes'(001)
icon_button_1 = 'ICON_OKAY'
text_button_2 = 'No'(002)
icon_button_2 = 'ICON_CANCEL'
default_button = '1'
display_cancel_button = 'X'
USERDEFINED_F1_HELP = ' '
start_column = 25
start_row = 6
POPUP_TYPE =
IMPORTING
answer = answer
TABLES
PARAMETER =
EXCEPTIONS
text_not_found = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CHECK answer EQ '1'.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
filename = p_file
filetype = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = i_final
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT i_final INTO wa_final .
PERFORM bdc_dynpro USING 'SAPLMGMM' '0060'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RMMG1-MATNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RMMG1-MATNR'
wa_final-matnr.
MOVE wa_final-matnr TO wa_result-matnr .
PERFORM bdc_dynpro USING 'SAPLMGMM' '0070'.
PERFORM bdc_field USING 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTR'.
PERFORM bdc_field USING 'MSICHTAUSW-KZSEL(01)'
'X'.
PERFORM bdc_dynpro USING 'SAPLMGMM' '4004'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
PERFORM bdc_field USING 'MAKT-MAKTX'
wa_final-maktx.
PERFORM bdc_field USING 'BDC_CURSOR'
'MARA-BISMT'.
PERFORM bdc_field USING 'MARA-BISMT'
wa_final-bismt.
PERFORM bdc_field USING 'MARA-BRGEW'
wa_final-brgew.
PERFORM bdc_field USING 'MARA-GEWEI'
wa_final-gewei.
MOVE wa_final-maktx TO wa_result-maktx .
MOVE wa_final-bismt TO wa_result-bismt .
MOVE wa_final-brgew TO wa_result-brgew .
MOVE wa_final-gewei TO wa_result-gewei .
PERFORM bdc_transaction USING 'MM02'.
flag = '1' Record updated successfully
flag = '2' Record not updated
IF flag = '1' .
APPEND wa_result TO right .
count1 = count1 + 1 .
ELSEIF flag = '2' .
APPEND wa_result TO wrong .
count2 = count2 + 1 .
ENDIF .
ENDLOOP.
Report Generation
WRITE : ' Success Item' .
SKIP .
WRITE : / ' Number of Success Items: ', count1 , ' Items.' .
SKIP .
WRITE: / 'Material Number ',
19 'Material Name',
59 'Old Mat. Name',
77 'Gross Wt.',
90 'Weight Unit',
105 'Message' .
WRITE: sy-uline .
LOOP AT right INTO wa_result .
WRITE: / wa_result-matnr ,
19 wa_result-maktx ,
59 wa_result-bismt ,
77 wa_result-brgew ,
90 wa_result-gewei ,
105 wa_result-message .
ENDLOOP .
SKIP 2 .
WRITE : /' Error Item' .
SKIP .
WRITE : / ' Number of Error Items: ', count2 , ' Items.' .
SKIP .
WRITE: / 'Material Number ',
19 'Material Name',
59 'Old Mat. Name',
77 'Gross Wt.',
90 'Weight Unit',
105 'Message' .
WRITE: sy-uline .
LOOP AT wrong INTO wa_result .
WRITE: / wa_result-matnr ,
19 wa_result-maktx ,
59 wa_result-bismt ,
77 wa_result-brgew ,
90 wa_result-gewei ,
105 wa_result-message .
ENDLOOP .
Reward Points if it is helpful
Rgds,
Naren
Message was edited by:
Naren Someneni -
How to use GUI_upload for Uploading a CSV file in Microsoft Excel.
Hi Guys,
can anybody tell me how to Upload the CSV format file in Microsoft excel sheet?
Thanks,
Gopi.Hi Gopi,
u can use GUI_UPLOAD, TEXT_CONVERT_XLS_TO_SAP.
Please check these codes.
Uploading data from CSV file format into internal table using GUI_UPLOAD
REPORT zupload MESSAGE-ID bd.
DATA: w_tab TYPE ZTEST.
DATA: i_tab TYPE STANDARD TABLE OF ZTEST.
DATA: v_subrc(2),
v_recswritten(6).
PARAMETERS: p_file(80)
DEFAULT 'C:\Temp\ZTEST.TXT'.
DATA: filename TYPE string,
w_ans(1) TYPE c.
filename = p_file.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Upload Confirmation'
* DIAGNOSE_OBJECT = ' '
text_question = p_file
text_button_1 = 'Yes'(001)
* ICON_BUTTON_1 = ' '
text_button_2 = 'No'(002)
* ICON_BUTTON_2 = ' '
default_button = '2'
* DISPLAY_CANCEL_BUTTON = 'X'
* USERDEFINED_F1_HELP = ' '
* START_COLUMN = 25
* START_ROW = 6
* POPUP_TYPE =
* IV_QUICKINFO_BUTTON_1 = ' '
* IV_QUICKINFO_BUTTON_2 = ' '
IMPORTING
answer = w_ans
* TABLES
* PARAMETER =
* EXCEPTIONS
* TEXT_NOT_FOUND = 1
* OTHERS = 2
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CHECK w_ans = 1.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = filename
* FILETYPE = 'ASC
has_field_separator = 'X'
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
data_tab = i_tab
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.
* SYST FIELDS ARE NOT SET BY THIS FUNCTION SO DISPLAY THE ERROR CODE *
IF sy-subrc <> 0.
v_subrc = sy-subrc.
MESSAGE e899 WITH 'File Open Error' v_subrc.
ENDIF.
INSERT ZTEST FROM TABLE i_tab.
COMMIT WORK AND WAIT.
MESSAGE i899 WITH sy-dbcnt 'Records Written to ZTEST'.
Uploading data from Excel file format into internal table using TEXT_CONVERT_XLS_TO_SAP
REPORT zupload_excel_to_itab.
TYPE-POOLS: truxs.
PARAMETERS: p_file TYPE rlgrap-filename.
TYPES: BEGIN OF t_datatab,
col1(30) TYPE c,
col2(30) TYPE c,
col3(30) TYPE c,
END OF t_datatab.
DATA: it_datatab type standard table of t_datatab,
wa_datatab type t_datatab.
DATA: it_raw TYPE truxs_t_text_data.
* At selection screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
*START-OF-SELECTION.
START-OF-SELECTION.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
* I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw " WORK TABLE
i_filename = p_file
TABLES
i_tab_converted_data = it_datatab[] "ACTUAL DATA
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* END-OF-SELECTION.
END-OF-SELECTION.
LOOP AT it_datatab INTO wa_datatab.
WRITE:/ wa_datatab-col1,
wa_datatab-col2,
wa_datatab-col3.
ENDLOOP.
reward if helpful
raam
Maybe you are looking for
-
When printing on a digital press, why are the colors different between INDD & PSD?
I've created the exact same CMYK mix in both InDesign and Photoshop. When printed on a digital press they are not the same color. Any ideas how this can be fixed/solved?
-
Pictures not showing up in gallery
Hi, this post is related to my previous post (can't figure out the path) and I would really apprecaite if any of you can shed some light on this. I'd been trying many hours to try to solve the problem myself, but I still cannot see what I did wrong,
-
Dear Friends I am an user of SD since last 3 years. I am planning to switch to Sap. So I am thinking about CRM functional (not SD because I think CRM has better prospect). Now while learning CRM functional, is it necessary that I should have any tec
-
Keynote 06 - Exporting to Quicktime
Okay, so I know how to export keeping the audio intact. My main problem is keeping all the timings I've created intact as I don't have ANYTHING happening "on click" in my presentation. It is all timed and I'm finding the delay between slides is too l
-
Business Area or Profit center
Hi Gurus, We are using Profit Center instead of Business area. Why they are using profit center? Please don't tell in business there is no upgraded Please tell except this one. Thanks Krishna