Messages in a batch input session
Hi,
I would like to catch the messages of a batch input session in order to inform user of clearing itens posted and not posted.
So i thought that SX_MESSAGE_TEXT_BUILD would work fine. Somebody can give an example of this kind of code.
Of course if you know another mean of solve the problem i will appreciate that.
Best Regards
João Fernandes
Hi,
loop at i_yerrlog into wa_yerrlog.
v_msg_id = wa_yerrlog-msgid.
v_msg_no = wa_yerrlog-msgnr.
v_msg_var1 = wa_yerrlog-msgv1.
v_msg_var2 = wa_yerrlog-msgv2.
v_msg_var3 = wa_yerrlog-msgv3.
v_msg_var4 = wa_yerrlog-msgv4.
* Creating message text
call function 'MESSAGE_PREPARE'
exporting
msg_id = v_msg_id
msg_no = v_msg_no
msg_var1 = v_msg_var1
msg_var2 = v_msg_var2
msg_var3 = v_msg_var3
msg_var4 = v_msg_var4
importing
msg_text = v_text1.
move-corresponding wa_yerrlog to wa_output2.
move v_text1 to wa_output2-mstxt.
append wa_output2 to i_output2.
endloop.
aRs
Similar Messages
-
Batch input session Information message
Hi,
Is there any way to display information messages in a batch input session. Suppose I have a batch input session running on a particular transaction.If in a particular screen, I want to display an information message to the user that ' Particular sales order has been created on date xx'. Is it possible.
Thanks &* Regards,
Vishnu PriyaHello,
It is not possible in the Batch input Session.
You can do it by <b>Call transaction</b>. But it not possible to give message at particular screen. Becuase we are only passing screen seq and data for the screen.
Like,
Call transaction Va01.
if something is there,
message I
endif.
regards,
Naimesh -
'S' message in BDC and message of type 'A' in batch input session
We have to upload data for ABZON transaction of assets. When we use LSMW with recording method and try to upload say 3 records. All teh records are updated successfully but the batch input session log says last two records with a message of type 'A' "leave transaction is not possible in batch input"
But when we upload the same data with BDC program with call transaction then teh log shows same message with type 'S'.
what could be the reason for this?
Though data gets uploaded successfully the 'A' message is being displayed in LSMW batch input log.
if anyone has encountered a similar problem pls let us know how to resolve this asap.
Thanks,
SimmiDid your batch input end with save ( /11 ) or what ok_code are you using ?
-
BDC programming using Batch input Session.
Hello Experts.
I'm an ABAP beginner. I've benn practicing BDC programming using Batch input Session
at the moment.
This is the program that upload Local file which has plural records, and put the records into a Session.
These are the records.
413459,KIM EI HWAN121 ,19810607,MIADONG1234
423459,KIM EI HWAN122 ,19810607,MIADONG1235
433459,KIM EI HWAN123 ,19810607,MIADONG1236
443459,KIM EI HWAN124 ,19810607,MIADONG1237
453459,KIM EI HWAN125 ,19810607,MIADONG1238
463459,KIM EI HWAN126 ,19810607,MIADONG1239
I succeeded making Session.
However, for some reaseon, every record in the Session has got the same, value which is the first record.
Why is this happening? And How can I correct the code below?
REPORT ZBCUSER002_BATCH NO STANDARD PAGE HEADING
LINE-SIZE 255
MESSAGE-ID ZBATCH.
= Types definition ===================================================
TYPES: BEGIN OF TYP_LOCAL, "For Local file upload
RECORD(200) TYPE C,
END OF TYP_LOCAL.
= Internal table definition ==============================================
DATA: BEGIN OF BDC_TAB OCCURS 0. "BDCDATA itab
INCLUDE STRUCTURE BDCDATA.
DATA: END OF BDC_TAB.
DATA: BEGIN OF MESSAGE_BDC OCCURS 0. "Message itab
INCLUDE STRUCTURE BDCMSGCOLL.
DATA: END OF MESSAGE_BDC.
DATA: TBL_LOCAL TYPE STANDARD TABLE OF TYP_LOCAL, "Local file itab
F_TBL TYPE FILETABLE. "FILETABLE fot local
= Structure table definition =========================================
DATA: STR_F_TBL LIKE LINE OF F_TBL, "FILETABLE structure
STR_LOCAL TYPE TYP_LOCAL. "Local file structure
= Variable definition ================================================
DATA: LV_RC TYPE I, "Method parameter
ENUMBER TYPE ZT601-ENUMBER, "Employee number
NAME TYPE ZT601-NAME, "Employee name
BIRTH TYPE ZT601-BIRTH, "Birthday
HOMETOWN TYPE ZT601-HOMETOWN, "Hometown
SYSVAL TYPE SY-SUBRC. "System valuible
= Constants definition ===============================================
CONSTANTS: TBL_NAME(10) TYPE C VALUE 'ZT601'. "Table name ZT601
= Parameters definition ==============================================
PARAMETERS: F_NAME TYPE RLGRAP-FILENAME OBLIGATORY, "File path
EXECMODE(1) TYPE C. "Execute mode
INITIALIZATION
*----- Initialize all valuables, structures and internal tables
CLEAR: LV_RC,
STR_F_TBL,
STR_LOCAL,
ENUMBER,
NAME,
BIRTH,
HOMETOWN.
REFRESH: F_TBL,
TBL_LOCAL.
AT SELECTION-SCREEN
*----- When the button next to Parameter 'F_NAME',
*----- File dialog open.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR F_NAME.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
EXPORTING
WINDOW_TITLE = 'SELECT FILE'
DEFAULT_FILENAME = '*.TXT'
CHANGING
FILE_TABLE = F_TBL
RC = LV_RC
EXCEPTIONS
FILE_OPEN_DIALOG_FAILED = 1
CNTL_ERROR = 2
OTHERS = 3
*----- system valiable check.
*----- If done properly,
*----- Put the path into the File path parameter
IF SY-SUBRC = 0.
READ TABLE F_TBL INTO STR_F_TBL INDEX 1.
F_NAME = STR_F_TBL.
*----- If not done properly, show message
*----- An error occured while getting file path then end program
ELSE.
MESSAGE E000.
ENDIF.
*----- Execute code can only be A or N.
AT SELECTION-SCREEN ON EXECMODE.
IF EXECMODE <> 'A' AND EXECMODE <> 'N'.
MESSAGE E001.
ENDIF.
START-OF-SELECTION
START-OF-SELECTION.
*----- Upload Local file of file path parameter.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = F_NAME
FILETYPE = 'ASC'
TABLES
DATA_TAB = TBL_LOCAL
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
OTHERS = 6.
*----- System valiable check.
*----- If not done properly, show an error message
*----- An error occured while uploading local file then end program
IF SY-SUBRC <> 0.
MESSAGE E002.
ENDIF.
PERFORM BDC_OPEN.
*----- Loop Internal table
LOOP AT TBL_LOCAL INTO STR_LOCAL.
*----- Spilt the file record and put them into each valiable.
SPLIT STR_LOCAL AT ',' INTO ENUMBER
NAME
BIRTH
HOMETOWN.
*----- Data check Function module
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
DATE = BIRTH
EXCEPTIONS
PLAUSIBILITY_CHECK_FAILED = 1
OTHERS = 2.
*----- When error occurs while checking date, show an error message.
*----- (&1) is not date
IF SY-SUBRC <> 0.
MESSAGE E003 WITH BIRTH.
ENDIF.
*-- The first screen of SE11
*----- Screen number 0102 of program id SAPMSRD0
PERFORM BDC_DYNPRO USING 'SAPMSRD0' '0102'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RSRD1-TBMA_VAL'. "Field on Cursor
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=SHOW'. "Display button
PERFORM BDC_FIELD USING 'RSRD1-TBMA'
'X'.
PERFORM BDC_FIELD USING 'RSRD1-TBMA_VAL'
TBL_NAME. "ZT601
*-- Table definition screen
*----- Screen number 2000 of program id SAPLSD02
PERFORM BDC_DYNPRO USING 'SAPLSD02' '2000'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'DD02D-TABCLTEXT'. "Field on Cursor
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=TDED'. "Create entry
PERFORM BDC_FIELD USING 'BDC_SUBSCR'
'SAPLSD02'.
PERFORM BDC_FIELD USING 'BDC_SUBSCR'
'SAPLSED5'.
*-- Data input screen
*----- Screen number 0101 of program /1BCDWB/DBZT601
PERFORM BDC_DYNPRO USING '/1BCDWB/DBZT601' '0101'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ZT601-CRUSER'. "Field on Cursor
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=SAVE'. "Save
PERFORM BDC_FIELD USING 'ZT601-MANDT'
SY-MANDT. "Client
PERFORM BDC_FIELD USING 'ZT601-ENUMBER'
ENUMBER. "Employee number
PERFORM BDC_FIELD USING 'ZT601-NAME'
NAME. "Employee name
PERFORM BDC_FIELD USING 'ZT601-BIRTH'
BIRTH. "Birthday
PERFORM BDC_FIELD USING 'ZT601-HOMETOWN'
HOMETOWN. "Hometown
PERFORM BDC_FIELD USING 'ZT601-CRDATE'
SY-DATUM. "System date
PERFORM BDC_FIELD USING 'ZT601-CRTIME'
SY-UZEIT. "System time
PERFORM BDC_FIELD USING 'ZT601-CRUSER'
SY-UNAME. "System user
*-- Data input screen (After input)
*----- Screen number 0101 of program /1BCDWB/DBZT601
PERFORM BDC_DYNPRO USING '/1BCDWB/DBZT601' '0101'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/EBACK'. "Back
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ZT601-CRUSER'. "Field on Cursor
*-- Table definition screen]
*----- Screen number 2000 of program SAPLSD02
PERFORM BDC_DYNPRO USING 'SAPLSD02' '2000'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'DD02D-TABCLTEXT'. "Field on Cursor
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=WB_BACK'. "Back
*-- The first screen of SE11
*----- Screen number 0102 of program SAPMSRD0
PERFORM BDC_DYNPRO USING 'SAPMSRD0' '0102'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RSRD1-TBMA_VAL'. "Field on Cursor
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=BACK'.
PERFORM BDC_FIELD USING 'RSRD1-TBMA'
'X'.
PERFORM BDC_FIELD USING 'RSRD1-TBMA_VAL'
TBL_NAME.
PERFORM BDC_INSERT.
ENDLOOP.
PERFORM BDC_CLOSE.
FORM BDC_DYNPRO *
Put Program-Id, Dynpro screen number, Start point
into DBCDATA
--> PROGRAM *
--> DYNPRO *
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR BDC_TAB.
BDC_TAB-PROGRAM = PROGRAM.
BDC_TAB-DYNPRO = DYNPRO.
BDC_TAB-DYNBEGIN = 'X'.
APPEND BDC_TAB.
ENDFORM.
FORM BDC_FIELD *
Put Field Name and Value into BDCDATA
--> FNAM *
--> FVAL *
FORM BDC_FIELD USING FNAM FVAL.
CLEAR BDC_TAB.
BDC_TAB-FNAM = FNAM.
BDC_TAB-FVAL = FVAL.
APPEND BDC_TAB.
ENDFORM.
FORM bdc_process *
FORM BDC_OPEN.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = 'Testsession'
KEEP = 'X'
USER = SY-UNAME.
IF SY-SUBRC <> 0.
MESSAGE E006 WITH SY-SUBRC.
ENDIF.
ENDFORM.
FORM bdc_insert *
FORM BDC_INSERT.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'SE11'
TABLES
DYNPROTAB = BDC_TAB
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
MESSAGE E007 WITH SY-SUBRC.
ENDIF.
CLEAR: BDC_TAB.
ENDFORM.
FORM bdc_close *
FORM BDC_CLOSE.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE E008 WITH SY-SUBRC.
ENDIF.
ENDFORM.God I forgot to refresh Internal table after putting record into Session.
Now I'm done.
You guys be careful too. -
How to see the Batch input session name in SM35 with User name.
Hi
Yesterday,User has created one Batch input session from FBWE and selected process button after that display errors only tick mark in SM35. Then the system displayed one error message"No Batch input data for screen SAPMF05A 0700".After that he came out from the screen. He dont know what happened.
Today we have verified in SM35. But there is no batch input session with his name. We have verified in incorrect screens and every thing in SM35.
We have verified in Table 'T045DTA'. There are some entries are there.
We dont know the session name also.
How we can find the session name created by the User.
We have not deleted any thing.
Please help me
Thanks
Ravi.Hi Ravi,
Yes, you should be able to create a new batch job for FBWE. You can see your own batch sessions from SYSTEM ==> OWN JOBS
Regards,
Mike -
Stopping a batch Input session
Hi,
I need to stop a job which is being processed. Please tel me how do i acheive this.
I've tried SM37 & went for release but it says 'cannot be done because of the stattus it has'
I've also tried to stop the batch using the push button in Appl tool bar in SM37 but still i have the same message.Hi..,
In the BDC_OKCODE,
give <b>/n</b> to stop that particular transaction...
give <b>/bend</b> to quit the entire Session....
You can interrupt the interactive execution of a session by entering the<b> /bend</b> OK code on any screen. <b>/bend </b>terminates the transaction currently being executed in the session and marks the transaction with the status Incorrect. The session is kept in the queue and is displayed in the Errors section of the list. Changes made by the interrupted transaction are rolled back as long as the transaction uses only the R/3 update facility. Direct database changes made by the transaction are not rolled back.
You can use <b>/bend</b> when testing sessions. For example, you may wish to run the first transactions of a large session in display-all mode to make sure that the session has been generated correctly.
You can restart processing of a transaction by entering the <b>/bbeg</b> OK code on any screen. <b>/bbeg </b>terminates the transaction that is currently being processed and then restarts the transaction fresh, as it is recorded in the batch input session. Any changes made by the transaction are rolled back, as long as they were made only by way of the R/3 update facility. Changes made directly to the database are not rolled back.
You can delete a transaction from a session during interactive execution by entering the <b>/bdel</b> OK code. The transaction is removed from the session. The deleted transaction cannot be run even if you restart the session, and you cannot take back the deletion.
regards,
sai ramesh
Message was edited by:
Sai ramesh -
LSMW Issue at step -Run Batch Input Session
Dear gurus,
While uploading service master through lSMW while processing the system prompts a message specifying "Buffertable not upto date" at Run Batch Input Session step .So please investigate what is missing/wrong.
Wirth regards,
RajI dont think that this has directly something to do with LSMW.
It is more related to the transaction your try to post in the batch input.
Search OSS with the error message number. I had seen some notes for number SE001, but your message is actually twice in the message table, and you did not tell the message number.
If it is message SE001, then you may find programm corrections in OSS.
Otherwise just log out and in again and try, or open a message at OSS yourself if the problem still persists -
How to delete batch input session still in process since year 2000
Hi All,
in our productive system we have still batch input session in process from year 2000, and I would like to delete them, but how to do this, because the error message is "Unable to schedule session .....".
Thanks for your helpHi Olivier ,
Such error occurs when you are trying to run session in foreground and some error occurs with connection.
As such these session are not harmful in any way. You can request basis person to remove those sessions.
Regards,
Mohaiyuddin -
LSMW - Error in Inventory - Create batch input session
Hello good day.
I'm trying to create a batch input session for inventory upload (Standard Batch Input program - RM07MMBL) and when I select the Name of logical file = "MM_INVENTORY_MANAGEMENT_GOODS_MOVEMENT" and press F8, the following error occurs:
<b>Sequential file mmgoods cannot be opened
Message no. M7 850</b>
Now as the legend says.... I've contacted my system administrator and he keeps telling me everything is ok, but the error keeps appearing, where can I see if I have authorization for this "file" ???
Where is it created ??
I need more info on this.
Your help is very much appreciated.
Thank you.
Juango to file transaction n check for the logical file path and logical file weather it is defined correctly r not?
if it is correctly defined check for the file, weather the flat file is defined at the correct location which is defined in the logical file path
u can refer the below link also
Re: Logical file
Regards,
Naveen -
LSMW- Batch Input session getting error
Hi All,
I created LSMW object for Tcode KO01 and its creating the Internal order as expceted.But even after creating the document the Batch Input session status is showing incorrect.No messages are also displayed in the log.
Please let me know why this is happening.
Thanks in Advance,
SavithaHi,
Detail Error Message is as follows:
No batch input data for screen SAPLIMR0 1110
Message no. 00344
Diagnosis
The transaction sent a screen that was not expected in the batch input session and which therefore could not be supplied with data.
Possible reasons:
1. The batch input session was created incorrectly. The sequence of screens was recordly incorrectly.
2. The transaction behaves differently in background processing in a batch work process than when running in dialog (SY-BATCH is queried and changes the screen sequence).
3. The transaction has undergone user-specific Customizing and therefore certain screens may be skipped or processed differently, according to the current user. If the person who created a batch input session is not the same as the person now processing it, this problem may occur frequently.
System Response
None.
Procedure
For 1: Either re-create the session or process it in expert mode. Correct the batch input program.
For 2. It is very difficult to analyze this problem, particularly in the case that the screen sequence or the display-only options of fields differ according to whether the transaction is being processed in the background or as an online dialog. It could also be that this kind of transaction cannot run with batch input.
For 3: Have the creator of the session process it. If no error occurs now, then this is a program with user-specific Customizing.
Regards,
ababfk -
Update error after all screens in Batch Input session is processed.
Hi,
I have a problem in processing the batch input session. The batch input session is calling F-02 to post less than 999 line items (around 700) to a single financial document. The batch session is expected to have an error because tax code is missing for some line items but even after the tax code is added manually onto the batch screen, the update error message still happened at the end of the process. In the log, it said "System error: Error when inserting table BSET". Same account has been used to post 10+ line items manually with F-02, no error occurred.
Does anyone have any idea what possible reason could cause the update error in updating the tax table?Hi Rob,
That is exactly what happened to us. We already had note 521481 in our system but we also have OSS 558288 in which causes our scenario not generating an error message but an update termination instead.
The other thing I found out is once tax code is entering in one of the line items, it will be copied to all the succeeding line items even for the accounts that does not require a tax code (i.e. posting without tax code allowed checked) which will significantly increase the amounts of data posted into BSET.
We fixed the issue by changing the BDC program so it will take out the auto-copied tax code from other line items. Issue is solved. Thank you. I also rewarded the points.
Minami -
Batch Input Session for Errors
Hello
I'm running a Batch Input (in a FM) and I want to create a session for records with errors. In case of error (output parameter of the FM subrc NE 0) I send it to that session for later running.
Can you explain how do I do this? Thanks!hi,
Look at the sample program
REPORT Z_BDC_CUSTOMER_R07
NO STANDARD PAGE HEADING LINE-SIZE 255.
INCLUDE Z_CUSTOMER_BDC_R02.
*-----AT SELECTION-SCREEN
AT SELECTION-SCREEN.
IF SY-UCOMM = 'ONLI'.
*-----group and user must be filled to create a session
IF SESSION = 'X' AND
GROUP = SPACE OR USER = SPACE.
MESSAGE E613(MS).
ENDIF.
*----Presentation File name should be entered
IF SESSION = 'X' AND RB_PRE = 'X'
AND P_FILE = '' .
MESSAGE E004(ZROJA).
ELSEIF CTU = 'X' AND RB_PRE = 'X'
AND P_FILE = '' .
MESSAGE E004(ZROJA).
ENDIF.
*----Application File name should be entered
IF SESSION = 'X' AND RB_APP = 'X'
AND P_FILE_A = '' .
MESSAGE E004(ZROJA).
ELSEIF CTU = 'X' AND RB_APP = 'X'
AND P_FILE_A = '' .
MESSAGE E004(ZROJA).
ENDIF.
ENDIF.
*-----AT SELECTION-SCREEN OUTPUT
AT SELECTION-SCREEN OUTPUT.
*----When file from Presentation server is selected
IF RB_PRE = 'X'.
*----To make the application server inactive
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'AAA'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
*----When file from Presentation server is selected
RB_APP = 'X'.
*----To make the application server inactive
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'BBB'.
SCREEN-ACTIVE = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
*-----AT SELECTION-SCREEN ON VALUE-REQUEST
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE_A.
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
I_LOCATION_FLAG = 'A'
I_SERVER = ' '
FILEOPERATION = 'R'
IMPORTING
O_PATH = P_FILE_A
EXCEPTIONS
RFC_ERROR = 1
ERROR_WITH_GUI = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*-----AT SELECTION-SCREEN ON VALUE-REQUEST
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
*-----Function module for value-request
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = V_FILE_NAME.
*----Assigning the flatfile to parameter
P_FILE = V_FILE_NAME.
*-----START-OF-SELECTION
START-OF-SELECTION.
DATA: FILENAME TYPE STRING.
*----When file from Presentation Server is selected
IF RB_PRE = 'X'.
FILENAME = P_FILE.
*-----Function module to upload data from the presentation server
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FILENAME
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = IT_KNA1
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.
ELSE.
*----Upload the File from Application Server
OPEN DATASET P_FILE_A FOR INPUT IN TEXT MODE ENCODING DEFAULT.
*-----to display an error if the file is not in application server
IF SY-SUBRC NE 0.
MESSAGE E006(ZROJA).
ELSE.
DO.
READ DATASET P_FILE_A INTO X_KNA1.
IF SY-SUBRC EQ 0.
APPEND X_KNA1 TO IT_KNA1.
ELSE.
EXIT.
ENDIF.
ENDDO.
ENDIF.
CLOSE DATASET P_FILE_A.
ENDIF.
*-----To open a batchinput session
IF SESSION = 'X'.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
GROUP = GROUP
KEEP = KEEP
USER = USER
PROG = SY-CPROG
EXCEPTIONS
CLIENT_INVALID = 1
DESTINATION_INVALID = 2
GROUP_INVALID = 3
GROUP_IS_LOCKED = 4
INTERNAL_ERROR = 6
QUEUE_ERROR = 7
RUNNING = 8
SYSTEM_LOCK_ERROR = 9
USER_INVALID = 10
OTHERS = 11.
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.
*-----Filling the BDCDATA using the Internal Table
LOOP AT IT_KNA1 INTO X_KNA1.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RF02D-KTOKD'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'RF02D-KUNNR'
X_KNA1-KUNNR.
PERFORM BDC_FIELD USING 'RF02D-KTOKD'
X_KNA1-KTOKD.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0110'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'KNA1-SPRAS'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'KNA1-NAME1'
X_KNA1-NAME1.
PERFORM BDC_FIELD USING 'KNA1-SORTL'
X_KNA1-SORTL.
PERFORM BDC_FIELD USING 'KNA1-ORT01'
X_KNA1-ORT01.
PERFORM BDC_FIELD USING 'KNA1-PSTLZ'
X_KNA1-PSTLZ.
PERFORM BDC_FIELD USING 'KNA1-LAND1'
X_KNA1-LAND1.
PERFORM BDC_FIELD USING 'KNA1-SPRAS'
X_KNA1-SPRAS.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0120'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'KNA1-LZONE'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'KNA1-LZONE'
X_KNA1-LZONE.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0125'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'KNA1-NIELS'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0130'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'KNBK-BANKS(01)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0340'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RF02D-KUNNR'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0370'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RF02D-KUNNR'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
PERFORM BDC_FIELD USING 'KNA1-CIVVE'
'X'.
PERFORM BDC_DYNPRO USING 'SAPMF02D' '0360'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'KNVK-NAMEV(01)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
*----If Session is selected
IF SESSION = 'X'.
*----To insert data into batch input session
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'XD01'
TABLES
DYNPROTAB = IT_BDCDATA.
REFRESH IT_BDCDATA.
AT LAST.
SKIP.
WRITE:/ TEXT-001.
ENDAT.
ELSE.
*----Calling the transaction
CALL TRANSACTION 'XD01' USING IT_BDCDATA
MODE CTUMODE
UPDATE CUPDATE
MESSAGES INTO IT_BDCMSGCOLL.
CLEAR IT_BDCDATA.
REFRESH IT_BDCDATA.
ENDIF.
ENDLOOP.
*----If Session is Selected
IF SESSION = 'X'.
*----To close the session
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
NOT_OPEN = 1
QUEUE_ERROR = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
*-----END-OF-SELECTION
END-OF-SELECTION.
*----To display the success messages
LOOP AT IT_BDCMSGCOLL INTO X_BDCMSGCOLL WHERE MSGTYP = 'S' .
*-----If Message Type Differs
ON CHANGE OF X_BDCMSGCOLL-MSGTYP.
WRITE:/ TEXT-002.
SKIP.
ULINE (58).
WRITE:/01 SY-VLINE,02 TEXT-003,
14 SY-VLINE,15 TEXT-004,
21 SY-VLINE,22 TEXT-005,
35 SY-VLINE,36 TEXT-006,
58 SY-VLINE,/01 SY-ULINE(58).
ENDON.
WRITE:/01 SY-VLINE,02 X_BDCMSGCOLL-MSGTYP,
14 SY-VLINE,15 X_BDCMSGCOLL-TCODE,
21 SY-VLINE,22 X_BDCMSGCOLL-MSGV1,
35 SY-VLINE,36 TEXT-007,
58 SY-VLINE,/01 SY-ULINE(58).
ENDLOOP.
SKIP 2.
*----To display the error messages
LOOP AT IT_BDCMSGCOLL INTO X_BDCMSGCOLL WHERE MSGTYP = 'E'.
*-----If Message Type Differs
ON CHANGE OF X_BDCMSGCOLL-MSGTYP.
WRITE:/ TEXT-008.
SKIP.
ULINE (58).
WRITE:/01 SY-VLINE,02 TEXT-003,
14 SY-VLINE,15 TEXT-004,
21 SY-VLINE,22 TEXT-005,
35 SY-VLINE,36 TEXT-006,
58 SY-VLINE,/01 SY-ULINE(58).
ENDON.
WRITE:/01 SY-VLINE,02 X_BDCMSGCOLL-MSGTYP,
14 SY-VLINE,15 X_BDCMSGCOLL-TCODE,
21 SY-VLINE,22 X_BDCMSGCOLL-MSGV1,
35 SY-VLINE,36 'Customer Already Exits',
58 SY-VLINE,/01 SY-ULINE(58).
ENDLOOP.
*-----FORM fill_bdcdata
FORM FILL_BDCDATA USING L_DYNPRO TYPE ANY
L_FNAME TYPE ANY
L_FVALUE TYPE ANY.
CLEAR X_BDCDATA.
IF L_DYNPRO = 'X'.
X_BDCDATA-DYNBEGIN = 'X'.
X_BDCDATA-PROGRAM = L_FNAME.
X_BDCDATA-DYNPRO = L_FVALUE.
ELSE.
X_BDCDATA-FNAM = L_FNAME.
X_BDCDATA-FVAL = L_FVALUE.
ENDIF.
APPEND X_BDCDATA TO IT_BDCDATA.
ENDFORM. "BDC_FIELD
*-----Start new screen
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR IT_BDCDATA.
IT_BDCDATA-PROGRAM = PROGRAM.
IT_BDCDATA-DYNPRO = DYNPRO.
IT_BDCDATA-DYNBEGIN = 'X'.
APPEND IT_BDCDATA.
ENDFORM. "BDC_DYNPRO
*-----Insert field
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> SPACE.
CLEAR IT_BDCDATA.
IT_BDCDATA-FNAM = FNAM.
IT_BDCDATA-FVAL = FVAL.
APPEND IT_BDCDATA.
ENDIF.
ENDFORM. "BDC_FIELD -
Batch Input Session not getting created at FF67 level
Hi,
I have posted two transactions at FF67 level - One check deposit ( + Rs. 40000/-) and One Check Issue (- Rs. 30000/-). After saving twice, message is shown statement listed and posted. When I go to overview, It says manual posting incomplete. When I try to look for batch input session, it has not been created. Can anybody in the forum guide me in this regard?
Regards,
V RAjeshwariHi
To resolve this problem, again go to the same T.code FF67, and in the overview, select the statement and press transfer.
After coming back to the main window, go to Settings - Specifications and ensure that you have selected processing type as '2'. Then try to post the statement.
If this does not work, please check whether any batch job scheduled/pending in SM37.
Regards -
Batch input session to FB01 using standard program RFBIBL00
Hi all,
I am creating a batch input session using the standard program RFBIBL00 to simulate transaction FB01.
My problem is when I process the "batch input session" (using transaction SM35), this finish ok, but in the log I am retrieving the following message:
"Field BSEG-DMBTR. does not exist in the screen SAPMF05A 0300"
This is a success message and the document is created ok,and the field DMBTR is informed ok.
Has somebody some idea?.
Thanks so much in advance for any answer.Hi gundam,
1. Or is there any method to wait here until the process is completed before further processing?
There is no such direct method to wait.
2. Immediately after submitting in background,
we cannot wait
neither can we LOOP and go on detecting
whether the b/g process has completed or not !
3. To over come such problems,
we have to use another technique.
4. we have to submit another
job which will get triggered
on event SAP_END_OF_JOB
ie. when the original job will finish,
our new job will AUTOMATICALLY get triggered,
5. This new job / program
will do the FURTHER actions !
regards,
amit m. -
Batch Input Session for RFUMSV50 is not getting processed.
Dear All,
When i am trying to transfer the Service Tax Inetrim account to Service tax final account with the help of the program RFUMSV50 the batch input session is getting generated without any error. But when i process the same in SM35 it is not getitng processed.
Please advice on this.
Regards,
Rajeswari Shankar.Hello Rajeswari,
Yes, this is normal.
When batch input sessions is generated with any error, this does not mean that you can execute it after via SM35 without any error
Moreover, you have the option in SM35 to execute it and with option "display error only", so this means that it can happen that there is no error
For example, the profit center is mandatory, and it is missing in the document. In that case the system will display error and ask you to fulfill the profit center
Please tell me, which error you have (message number)
Thanks
Tarek
Maybe you are looking for
-
How do I connect to an SMTP server that requires a username and password?
Hi, I am currently working on a project for university which requires me to send and receive email. I was until this week able to send mail no problem, but now the SMTP server has been upgraded so that each time a mail is sent it requires the usernam
-
Does excel sheets work on Numbers3.0
can you open an excel work sheet in numbers 3.0?
-
Windows configures itunes on start up then leaves two files in my recycling
Windows configures itunes on start up then leaves two files in my recycling without starting. Does anybody know why i cant get itunes to open?
-
After upgrading from cs5 to cs6, do I have to upgrade extensis fusion 3 to 4?
Do I have to upgrade from fusion 3 to 4 now that I have upgraded cs5 to cs6? And do you know if extensis offers student discounts? I can't find anything on the 'net or their site, but I thought I'd ask here too before I buy the upgrade for (ugh) $50.
-
Server 2008 RRAS Internal adaptor causing duplicate DNS entry for host
I have Server 2008 configured with AD, DNS, DHCP and Routing and Remote Access. The Server is set-up with a static IP address 192.168.127.2 and the DHCP allocates addresses in the range 192.168.127.100/199 to clients. The RRAS is automatically conf