BDC batch interface error /SAPAPO/SCC05
I have created an ABAP program that does a CALL TRANSACTION to transaction /SAPAPO/SCC05 (in an APO program). If I run the program in foreground (the CALL TRANSACTION in background mode), everything works correctly. However, when I try to run the program as a batch job, I receive an error message: "Error calling up user interface components".
I tried changing the CALL TRANSACTION to simply create a BDC session I could run via SM35. The BDC, when run in background mode, gives the same error, but runs fine in foreground.
I located an OSS Note (below) that references the error message (/SAPAPO/SCC 032) (<--message class/message number). I tried changing the settings outlined in the alternative solution in the OSS note, but the problem is still there.
In addition, I have tried to toggle all the different parameters that one has control over in the CALL TRANSACTION (default screen-size, commit work, etc.) No differences that I could find.
Has anyone run into a similar issue? I can be reached at [email protected]. Thank you.
Here is the OSS Note:
SAP Note No. 396020 15.12.2005 Page 1
Number 396020
Version 2 from 17.04.2001
Status Released for Customer
Set on 16.04.2001
Language EN
Master language DE
Short text Error when calling PPM maintenance, SCE or SCC
Responsible SAP AG
Component SCM-APO-OCX
ActiveX controls
Long text
Symptom
When you call the graphical PPM maintenance or SCC/SCE, the system
displays error message "Error calling up user interface components"
/SAPAPO/SCC032
Additional key words
APO-SCC
Cause and prerequisites
You installed a valid APO Frontend patch correctly. When you use
PPM/SCE/SCC now a very rare constellation can occur, a graphical user
setting may be outside of the allowed value area. Thus, when you call
the respective application for the specific user the system displays an
error message of the frontend.
Solution
Workaround:
If possible, create a new user ID for the respective user.
Alternatively:
In database table /SAPAPO/CP_USRPRfor the respective user and for the
respective application (field APPLID) set fields 'MAP CO ********' to
initial (value 0). Note that for changes directly in database tables you
have to be very careful
A solution is being developed. We will update this note as soon as
possibly.
Source code corrections
Page 2
Valid releases
Software Component Release
from to
SAP_APPL SAP Application
46C - 46C
SAP_APO SAP Advanced Planner & Optimizer
30A - 30A
Further components
SCM-APO-MD-PPM
Production Process Model
Hey Mike. If it is using any enjoy controls, it is really not a good idea to do a BDC over the transaction. You should find another way to do the transaction, maybe there is a BAPI available or a function module. Or, is there a transaction that does the same with out the controls. In R/3 v46c, there are transaction like ME21(Creat Po) that is the old version, but works the same way as the ME21N which is the enjoy transaction.
My advise is to find another way to do the transaction besides using the tcode that you are currently using. I know that this is not much help. Sorry
Please remember to award points for helpful answers and mark your post as solved when solved completely. Thanks in advance
Regards,
Rich Heilman
Similar Messages
-
Hi All
1) Please give me a clear picture about BDC and Interfaces, what are the differences between?
2) What is the usage of Update Mode(Synchronous, Asynchronous and Local), please explain me differences between them?
Awaiting for your response.
Regards
Praveen1)
http://help.sap.com/saphelp_47x200/helpdata/en/fa/097140543b11d1898e0000e8322d00/frameset.htm
2)
You use the UPDATE parameter to specify how updates produced by a transaction should be processed. You can select between these modes:
A Asynchronous updating. In this mode, the called transaction does not wait for any updates it produces to be completed. It simply passes the updates to the SAP update service. Asynchronous processing therefore usually results in faster execution of your data transfer program.
Asynchronous processing is NOT recommended for processing any larger amount of data. This is because the called transaction receives no completion message from the update module in asynchronous updating. The calling data transfer program, in turn, cannot determine whether a called transaction ended with a successful update of the database or not.
If you use asynchronous updating, then you will need to use the update management facility (Transaction SM12) to check whether updates have been terminated abnormally during session processing. Error analysis and recovery is less convenient than with synchronous updating.
S Synchronous updating. In this mode, the called transaction waits for any updates that it produces to be completed. Execution is slower than with asynchronous updating because called transactions wait for updating to be completed. However, the called transaction is able to return any update error message that occurs to your program. It is much easier for you to analyze and recover from errors.
L Local updating. If you update data locally, the update of the database will not be processed in a separate process, but in the process of the calling program. (See the ABAP keyword documentation on SET UPDATE TASK LOCAL for more information.)
Regards,
Rich Heilman -
BDC Batch input session method
Hi ,
I am new to SAP progamming. Pls let me know the basics of BDC Batch Input session method and Call transaction method. I want to know the pros and cons of both methods with justification. Please help me in this regarding.Hi,
Session method.
1) synchronous processing.
2) can tranfer large amount of data.
3) processing is slower.
4) error log is created
5) data is not updated until session is processed.
Call transaction.
1) asynchronous processing
2) can transfer small amount of data
3) processing is faster.
4) errors need to be handled explicitly
5) data is updated automatically
Check these link:
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
http://www.sap-img.com/abap/question-about-bdc-program.htm
http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
http://www.planetsap.com/bdc_main_page.htm
Session method:
1. Data migration is done in two steps .. Generate session and Process session.
So resouces can be used efficiently. good for bulkdata migration.
2. Session method generates error log when u process a session.
3. No SY-SUBRC can be returned after each transaction is called.
4. Provides synchronous Updation only...
Call transaction method:
1. Data migration is done in single steps ..bcoz Transactions are called immediately after filling BDCDATA table. So good for small amount of data.
2. We have to collect error messages using BDCMSGCOLL Table
3. Returns SY-SUBRC and Messages ..after each Call Transaction..very useful feature for further processing based on the Status and Messages..
4. Supports Asynch or Synch Updation.
Example code for session method
Here is the porgram for Purchase order
REPORT zmm0069 NO STANDARD PAGE HEADING
MESSAGE-ID z0
LINE-SIZE 132
LINE-COUNT 65(2).
Internal Tables *
*Internal table for the purchasing info records fields.
DATA: BEGIN OF i_inforecord OCCURS 0,
matnr(18),
lifnr(10),
uom(3),
ekgrp(3),
planned_time(3),
under_tol(3),
over_tol(3),
qty(10),
price_cat(5),
inco(3),
designation(28),
netpr(13),
scale_qty1(10),
scale_pr1(13),
scale_qty2(10),
scale_pr2(13),
scale_qty3(13),
scale_pr3(10),
scale_qty4(13),
scale_pr4(10),
scale_qty5(13),
scale_pr5(10),
scale_qty6(13),
scale_pr6(10),
scale_qty7(13),
scale_pr7(10),
scale_qty8(13),
scale_pr8(10),
scale_qty9(13),
scale_pr9(10),
scale_qty10(13),
scale_pr10(10),
END OF i_inforecord.
Internal table for Old and New Vendor number
DATA : BEGIN OF i_lfb1 OCCURS 1,
lifnr(10),
altkn(10),
END OF i_lfb1.
Declare internal table for Call Transaction and BDC Session
DATA: i_bdc_table LIKE bdcdata OCCURS 0 WITH HEADER LINE.
Global Variables *
DATA: g_counter(2) TYPE n,
g_field_name(18) TYPE c,
zc_yes TYPE syftype VALUE 'X'.
Selection Screen *
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
PARAMETERS: p_fname1 TYPE localfile .
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002.
PARAMETERS: p_rloc1 AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-003.
PARAMETERS p_group(12) OBLIGATORY DEFAULT 'ZPURCHINFO'.
SELECTION-SCREEN END OF BLOCK c.
SELECTION-SCREEN END OF BLOCK b.
SELECTION-SCREEN END OF BLOCK a.
**WRITE the report header
TOP-OF-PAGE.
INCLUDE zheading.
Start of selection *
START-OF-SELECTION.
Load Input file
PERFORM f_load_input_file.
Create BDC records.
PERFORM create_bdc_records .
*& Form Create_BDC_records
Perform the BDC for the records in the internal table
FORM create_bdc_records .
IF NOT i_inforecord[] IS INITIAL.
Open BDC session
PERFORM open_bdc_session.
SELECT lifnr altkn FROM lfb1 INTO TABLE i_lfb1
FOR ALL ENTRIES IN i_inforecord
WHERE altkn = i_inforecord-lifnr.
Sorting the Internal table for better performance
SORT i_lfb1 BY altkn.
LOOP AT i_inforecord.
***Mapping Old Vendor number to the new Vendor number
READ TABLE i_lfb1 WITH KEY altkn = i_inforecord-lifnr BINARY
SEARCH.
IF sy-subrc EQ 0.
i_inforecord-lifnr = i_lfb1-lifnr.
ENDIF.
CLEAR i_bdc_table[].
PERFORM insert_screen_header.
call transaction 'ME11' using i_bdc_table
mode 'A'.
CLEAR i_bdc_table.
ENDLOOP.
CLEAR i_inforecord[].
PERFORM close_bdc_session.
Release the BDC sessions created
PERFORM release_bdc.
ENDIF.
ENDFORM. " open_group
*& Form bdc_dynpro_start
Start the screen for the transfer of fields
FORM bdc_dynpro_start USING p_g_program_1
p_g_screen.
CLEAR i_bdc_table.
i_bdc_table-program = p_g_program_1.
i_bdc_table-dynpro = p_g_screen.
i_bdc_table-dynbegin = 'X'.
APPEND i_bdc_table.
ENDFORM. " bdc_dynpro_start_start
*& Form bdc_insert_field
Insert field *
FORM bdc_insert_field USING f_name f_value.
IF f_value <> space.
CLEAR i_bdc_table.
i_bdc_table-fnam = f_name.
i_bdc_table-fval = f_value.
APPEND i_bdc_table.
ENDIF.
ENDFORM. "bdc_insert_field
*& Form open_bdc_session
Open a BDC session
FORM open_bdc_session .
Open BDC session and create and update records
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
DEST = FILLER8
group = p_group
HOLDDATE = FILLER8
keep = 'X'
user = sy-uname
RECORD = FILLER1
PROG = SY-CPROG
IMPORTING
QID =
EXCEPTIONS
client_invalid = 1
destination_invalid = 2
group_invalid = 3
group_is_locked = 4
holddate_invalid = 5
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.
ENDFORM. " create_bdc_session
*& Form insert_screen_header
Screen flow for the transfer of fields
FORM insert_screen_header .
First Screen 100
PERFORM bdc_dynpro_start USING 'SAPMM06I' '0100'.
PERFORM bdc_insert_field USING:'BDC_CURSOR' 'EINA-LIFNR',
'BDC_OKCODE' '/00',
'EINA-LIFNR' i_inforecord-lifnr,
'EINA-MATNR' i_inforecord-matnr,
'EINE-EKORG' '1000',
'RM06I-NORMB' zc_yes.
Next Screen 101
PERFORM bdc_dynpro_start USING 'SAPMM06I' '0101'.
PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'EINA-MAHN1',
'BDC_OKCODE' '/00',
'EINA-MEINS' i_inforecord-uom.
*Next Screen 102
PERFORM bdc_dynpro_start USING 'SAPMM06I' '0102'.
PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'EINE-INCO2',
'EINE-APLFZ' i_inforecord-planned_time,
'EINE-EKGRP' i_inforecord-ekgrp,
'EINE-NORBM' i_inforecord-qty.
PERFORM bdc_insert USING 'EINE-UEBTK' ' '.
PERFORM bdc_insert_field USING:'EINE-PEINH' i_inforecord-scale_qty1,
'EINE-BPRME' i_inforecord-uom,
'EINE-UNTTO' '5',
'EINE-UEBTO' '25',
'EINE-MEPRF' i_inforecord-price_cat,
'EINE-NETPR' i_inforecord-netpr,
'EINE-INCO1' i_inforecord-inco,
'EINE-INCO2' i_inforecord-designation.
Checking for Scale quantities
IF i_inforecord-scale_qty2 = space.
PERFORM bdc_insert_field USING 'BDC_OKCODE' '=BU'.
PERFORM insert_bdc_new.
ELSE.
PERFORM bdc_insert_field USING 'BDC_OKCODE' '=KO'.
Next Screen 201
PERFORM bdc_dynpro_start USING 'SAPMV13A' '0201'.
PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'RV13A-DATAB',
'BDC_OKCODE' '=PSTF'.
Next Screen 201
PERFORM bdc_dynpro_start USING 'SAPMV13A' '0201'.
PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'KONP-KSCHL(01)',
'BDC_OKCODE' '=PSTF',
'RV130-SELKZ(01)' zc_yes.
LAST SCREEN 303
PERFORM bdc_dynpro_start USING 'SAPMV13A' '0303'.
PERFORM bdc_insert_field USING : 'BDC_CURSOR' 'KONM-KBETR(03)',
'BDC_OKCODE' '=SICH'.
Counter to Loop the Item level entry
g_counter = 0.
PERFORM scale_entry USING i_inforecord-scale_qty2
i_inforecord-scale_pr2.
PERFORM scale_entry USING i_inforecord-scale_qty3
i_inforecord-scale_pr3.
PERFORM scale_entry USING i_inforecord-scale_qty4
i_inforecord-scale_pr4.
PERFORM scale_entry USING i_inforecord-scale_qty5
i_inforecord-scale_pr5.
PERFORM scale_entry USING i_inforecord-scale_qty6
i_inforecord-scale_pr6.
PERFORM scale_entry USING i_inforecord-scale_qty7
i_inforecord-scale_pr7.
PERFORM scale_entry USING i_inforecord-scale_qty8
i_inforecord-scale_pr8.
PERFORM scale_entry USING i_inforecord-scale_qty9
i_inforecord-scale_pr9.
PERFORM scale_entry USING i_inforecord-scale_qty10
i_inforecord-scale_pr10.
PERFORM insert_bdc_new.
ENDIF.
ENDFORM. " insert_screen_header
*& Form insert_bdc
Insert BDC
FORM insert_bdc_new .
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = 'ME11'
POST_LOCAL = NOVBLOCAL
PRINTING = NOPRINT
SIMUBATCH = ' '
CTUPARAMS = ' '
TABLES
dynprotab = i_bdc_table
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 ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CLEAR i_bdc_table[].
ENDFORM. " insert_bdc
*& Form close_bdc_session
Close the BDC session
FORM close_bdc_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.
ENDFORM. " close_bdc_session
*& Form f_load_input_file
Upload the file
FORM f_load_input_file.
Check always Local file for upload
IF p_rloc1 = zc_yes.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_fname1
filetype = 'DAT'
TABLES
data_tab = i_inforecord
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.
STOP.
ENDIF.
ENDIF.
ENDFORM. " f_load_input_file
*& Form release_bdc
Release the session
FORM release_bdc.
SUBMIT rsbdcsub WITH mappe EQ p_group
WITH von EQ sy-datum
WITH bis EQ sy-datum
WITH fehler EQ '.'
EXPORTING LIST TO MEMORY
AND RETURN.
ENDFORM. " release_bdc
*& Form scale_entry
Populate the Scale quantities
-->P_SCALE_QTY
-->P_SCALE_PRICE
FORM scale_entry USING p_scale_qty
p_scale_price.
Increment the Counter
g_counter = g_counter + 1.
IF p_scale_qty <> space.
CONCATENATE 'KONM-KSTBM(' g_counter ')' INTO g_field_name.
PERFORM bdc_insert_field USING g_field_name p_scale_qty.
CONCATENATE 'KONM-KBETR(' g_counter ')' INTO g_field_name.
PERFORM bdc_insert_field USING g_field_name p_scale_price.
ENDIF.
ENDFORM.
*& Form bdc_insert
To uncheck the Unlimited (UEBTK)
FORM bdc_insert USING f_name f_value.
CLEAR i_bdc_table.
i_bdc_table-fnam = f_name.
i_bdc_table-fval = f_value.
APPEND i_bdc_table.
ENDFORM. " bdc_insert
Reward points if it is usefull ....
Cheers,
Chandra Sekhar. -
RFBIBL00 for FB01 - BATCH INPUT ERROR
Hi,
When am trying to post from foreground i found an error
"Field DKACB-XERGO. does not exist in the screen SAPLKACB-0002"
such errors come for only certain GL account, could you provide me a solution?Hi Dear,
Call Rfbibl00 in you program and submit your structure to rfbibl00. Here is the sample code....c how i have submitted in back ground i have given commenting in code it will b easier for you.
Still issues feel free to ask.
Reward for program
DATA :w_t001 LIKE t001,
w_gjahr LIKE bkpf-gjahr,
w_poper LIKE t009b-poper,
BEGIN OF it_input1 OCCURS 0,
data(10000),
END OF it_input1,
separator(1) TYPE c VALUE ';',
input_line(10000),
count TYPE i,
i_lines TYPE i,
BEGIN OF it_input OCCURS 0,
ind(1), " indicator for feild
bldat(8), " DOC DATE
blart(2), " DOC TYPE
bukrs(4), " COMPANY CODE
budat(8), " POSTING DATE
waers(5), " CURRENCY
xblnr(16), " HEADER REF
bktxt(25), " HEADER TXT
newbs(2), " POSTING KEY
newko(17), " ACCOUNT
newum(1), " SPL GL INDICATOR
wrbtr(13), " AMOUNT IN FOR CURRENCY
dmbtr(13), " AMOUNT IN LOCAL CURRENCY
zterm(4), " PAYAMENT TERMS
zfbdt(10), " BASE LINE DATE
wt_wit(2), " WITH TAXCODE
wt_qs(15), " WITH TAXCODE
wt_qb(15), " WITH TAXAMOUNT
mwskz(2), " TAXCODE
bupla(4), " BUSINESS PLACE
newbk(4), " LINE ITEM COMAPNY CODE
kostl(10), " COSTCENTER
aufnr(12), " INTERNAL ORDER
prctr(10), " PROFIT CENTER
pernr(8), " PERSONAL NUMBER
zuonr(18), " ASSIGNMENT
xref1(12), " REF1
xref2(12), " REF2
xref3(20), " REF3
sgtxt(50), " LINE TEXT
END OF it_input,
it_tmp_input LIKE it_input OCCURS 0 WITH HEADER LINE.
DATA : file TYPE string,
file1 TYPE string.
path on which error and complete directories are placed
DATA : w_path_err(100) TYPE c VALUE '\usr\sap\DEV\interfaces\ERROR\',
w_path_comp(100) TYPE c VALUE '\usr\sap\DEV\interfaces\COMPLETE\',
w_path_capinv(200) TYPE c VALUE '\usr\sap\DEV\interfaces\IN\SETDDN\',
w_path_capinv1(200) TYPE c, "contains the path of the file in the its original directory eg SETDDN
w_path_capinv2(200) TYPE c, "contains the path of the error file in the error directory eg ERROR
w_path_capinv3(200) TYPE c. "contains the path of the file in the complete directory eg COMPLETE
type declaration for headerref
TYPES : BEGIN OF ty_input_err,
xblnr(16), " HEADER REF
item_no(4),
err_text(500),
END OF ty_input_err.
DATA : it_input_err TYPE STANDARD TABLE OF ty_input_err,
wa_input_err LIKE LINE OF it_input_err.
variables for validations
DATA : w_post TYPE c,
w_xblnr TYPE bkpf-xblnr,
w_wrbtr TYPE i,
w_wrbtr1 TYPE i,
w_wrbtr2 TYPE i,
w_newko(10) TYPE c,
w_count1 TYPE n.
DATA :
w_path LIKE rlgrap-filename,
w_file LIKE rlgrap-filename,
w_dir LIKE rlgrap-filename,
w_dir1 LIKE epsf-epsdirnam,
w_file1 LIKE epsf-epsfilnam,
w_flag TYPE i,
w_budat TYPE budat,
w_flag_s TYPE c,
w_file_comp LIKE rlgrap-filename.
DATA : BEGIN OF it_file OCCURS 0.
INCLUDE STRUCTURE epsfili.
DATA: END OF it_file.
FIELD-SYMBOLS: <fs>.
DATA: BEGIN OF bdcdata OCCURS 100.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdcdata.
DATA : BEGIN OF it_data OCCURS 0,
f1(10000),
END OF it_data.
DATA : wa_bgr00 LIKE bgr00,
wa_bbkpf LIKE bbkpf,
wa_bbkpf1 LIKE bbkpf,
wa_bbseg LIKE bbseg,
w_param_1 LIKE filename-fileintern,
x_file(500),
w_move_file LIKE epsf-epsfilnam,
w_from_dir LIKE epsf-epsdirnam.
type declaration for validations
TYPES : BEGIN OF ty_blart,
blart TYPE t003-blart,
END OF ty_blart.
TYPES : BEGIN OF ty_xblnr,
xblnr TYPE bkpf-xblnr,
END OF ty_xblnr.
TYPES : BEGIN OF ty_mwskz,
mwskz TYPE t007a-mwskz,
END OF ty_mwskz.
TYPES : BEGIN OF ty_qsskz,
qsskz TYPE t059q-qsskz,
END OF ty_qsskz.
TYPES : BEGIN OF ty_zterm,
zterm TYPE t052-zterm,
END OF ty_zterm.
TYPES : BEGIN OF ty_bschl,
bschl TYPE tbsl-bschl,
END OF ty_bschl.
TYPES : BEGIN OF ty_umskz,
umskz TYPE t074u-umskz,
END OF ty_umskz.
TYPES : BEGIN OF ty_prctr,
prctr TYPE cepc-prctr,
END OF ty_prctr.
TYPES : BEGIN OF ty_kostl,
kostl TYPE csks-kostl,
END OF ty_kostl.
TYPES : BEGIN OF ty_branch,
branch TYPE j_1bbranch-branch,
END OF ty_branch.
TYPES : BEGIN OF ty_seccode,
seccode TYPE seccode-seccode,
END OF ty_seccode.
TYPES : BEGIN OF ty_tbsl,
bschl TYPE tbsl-bschl,
shkzg TYPE tbsl-shkzg,
END OF ty_tbsl.
TYPES : BEGIN OF ty_aufnr,
aufnr TYPE aufk-aufnr,
END OF ty_aufnr.
TYPES : BEGIN OF ty_pernr,
pernr TYPE pa0001-pernr,
END OF ty_pernr.
TYPES : BEGIN OF ty_ska1,
saknr TYPE ska1-saknr,
END OF ty_ska1.
TYPES : BEGIN OF ty_lfa1,
lifnr TYPE lfb1-lifnr,
bukrs TYPE lfb1-bukrs,
END OF ty_lfa1.
internal table declaration for validation
DATA : it_blart TYPE STANDARD TABLE OF ty_blart,
it_mwskz TYPE STANDARD TABLE OF ty_mwskz,
it_umskz TYPE STANDARD TABLE OF ty_umskz,
it_xblnr TYPE STANDARD TABLE OF ty_xblnr,
it_qsskz TYPE STANDARD TABLE OF ty_qsskz,
it_zterm TYPE STANDARD TABLE OF ty_zterm,
it_bschl TYPE STANDARD TABLE OF ty_bschl,
it_prctr TYPE STANDARD TABLE OF ty_prctr,
it_kostl TYPE STANDARD TABLE OF ty_kostl,
it_branch TYPE STANDARD TABLE OF ty_branch,
it_seccode TYPE STANDARD TABLE OF ty_seccode,
it_tbsl TYPE STANDARD TABLE OF ty_tbsl,
it_aufnr TYPE STANDARD TABLE OF ty_aufnr,
it_pernr TYPE STANDARD TABLE OF ty_pernr,
it_ska1 TYPE STANDARD TABLE OF ty_ska1,
it_lifnr TYPE STANDARD TABLE OF ty_lfa1.
DATA : wa_it_tbsl LIKE LINE OF it_tbsl.
DATA : w_date TYPE sy-datum,
w_check TYPE c ,
w_item_no TYPE i.
CONSTANTS : c_under TYPE c VALUE '_',
c_ext(4) TYPE c VALUE '.txt'.
Input file
SELECTION-SCREEN BEGIN OF BLOCK inp WITH FRAME TITLE text-001.
PARAMETERS :
pr_serv RADIOBUTTON GROUP abc DEFAULT 'X',
pr_sfile TYPE filename-fileintern,
pr_lok RADIOBUTTON GROUP abc,
pr_lfile TYPE filename-fileextern.
SELECTION-SCREEN END OF BLOCK inp.
--- output
SELECTION-SCREEN BEGIN OF BLOCK out WITH FRAME TITLE text-002.
PARAMETERS : pr_group LIKE bgr00-group OBLIGATORY DEFAULT '1000EXPENSE', " batch input structure for sessiondata
pr_xkeep LIKE bgr00-xkeep DEFAULT 'X' NO-DISPLAY,
pr_max(4) TYPE n DEFAULT '8000',
callmode LIKE rfpdo-rfbifunct , " Function for Generating Posting
pr_nodta LIKE bgr00-nodata DEFAULT '/' NO-DISPLAY,
pr_out LIKE rlgrap-filename,
pr_err LIKE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK out.
Company code and currency
SELECTION-SCREEN BEGIN OF BLOCK def WITH FRAME TITLE text-003.
PARAMETERS : pr_bukrs LIKE t001-bukrs,
pr_waers LIKE bkpf-waers.
SELECTION-SCREEN END OF BLOCK def.
Read file from server
PERFORM f001_upload_file.
*& Form create_doc
text
--> p1 text
<-- p2 text
FORM f003_create_doc.
DATA : l_count TYPE i.
DATA : w_session TYPE i.
CLEAR w_flag_s.
CLEAR l_count.
LOOP AT it_input.
IF l_count = 0 AND w_flag_s NE 'X'.
REFRESH it_data.
ENDIF.
*Commented code for background processing
IF it_data[] IS INITIAL.
PERFORM bdc_bgr00.
IF NOT w_session IS INITIAL.
APPEND wa_bbkpf1 TO it_data.
APPEND it_data.
MOVE 'X' TO w_flag_s.
ENDIF.
ENDIF.
IF NOT it_input-ind IS INITIAL.
ADD 1 TO l_count.
PERFORM header_record.
PERFORM item_record.
CLEAR w_flag_s.
ELSE.
PERFORM item_record.
ENDIF.
IF l_count > 18 .
PERFORM save_on_server.
PERFORM post_document.
ADD 1 TO w_session.
l_count = 0.
REFRESH it_data.
ENDIF.
ENDLOOP.
IF NOT it_data[] IS INITIAL.
PERFORM save_on_server.
PERFORM post_document.
ENDIF.
*moving the file name to temporary variable.
CONCATENATE w_path_comp it_file-name INTO w_path_capinv3.
OPEN DATASET w_path_capinv3 FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
*w_path_capinv2 contains the path of the error file.
*so all of the content of it_input is tranfered to file which is stored in the error.
LOOP AT it_input.
TRANSFER it_input TO w_path_capinv3 .
IF sy-subrc NE 0.
MESSAGE i001(mg) WITH w_path_capinv3 . " error writing to sequential file
MESSAGE a099(mg). " processing terminated
ENDIF.
ENDLOOP.
CLOSE DATASET w_path_capinv3.
CLEAR w_path_capinv3.
*After successful posting of the file that file is deleted form its original directory.
CONCATENATE w_path_capinv it_file-name INTO w_path_capinv1.
DELETE DATASET w_path_capinv1.
CLEAR w_path_capinv1.
-------------- save file on appl. server -----------------
perform save_on_server.
-------------- call RFBIBL00 -----------------------------
perform call_rfbibl00.
ENDFORM. " create_doc
*& Form header_record
text
--> p1 text
<-- p2 text
FORM header_record.
PERFORM fill_in_nodata_character CHANGING wa_bbkpf.
wa_bbkpf-stype = '1'.
wa_bbkpf-tcode = 'FB01'.
Check the file is for the valid company code.
SELECT SINGLE * INTO w_t001 FROM t001
WHERE bukrs EQ pr_bukrs.
IF sy-subrc NE 0.
MESSAGE a899 WITH text-021 pr_bukrs.
ENDIF.
Determine period
CALL FUNCTION 'FI_PERIOD_DETERMINE'
EXPORTING
i_budat = sy-datum
i_bukrs = pr_bukrs
IMPORTING
e_gjahr = w_gjahr
e_poper = w_poper
EXCEPTIONS
fiscal_year = 1
period = 2
period_version = 3
posting_period = 4
special_period = 5
version = 6
posting_date = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
wa_bbkpf-bukrs = pr_bukrs.
Document type
IF NOT it_input-blart IS INITIAL.
wa_bbkpf-blart = it_input-blart.
ENDIF.
Document date and Posting date.
IF NOT it_input-budat IS INITIAL.
wa_bbkpf-budat = it_input-budat.
ENDIF.
*new changes for background.
MOVE it_input-budat TO w_budat.
*end change.
IF NOT it_input-bldat IS INITIAL.
wa_bbkpf-bldat = it_input-bldat.
ENDIF.
Reference document number
IF NOT it_input-xblnr IS INITIAL.
wa_bbkpf-xblnr = it_input-xblnr.
ENDIF.
Currency
wa_bbkpf-waers = pr_waers.
wa_bbkpf-kursf = it_input-kursf.
IF NOT it_input-bktxt IS INITIAL.
wa_bbkpf-bktxt = it_input-bktxt.
ENDIF.
APPEND wa_bbkpf TO it_data.
MOVE wa_bbkpf TO wa_bbkpf1.
ENDFORM. " header_record
*& Form item_record
text
--> p1 text
<-- p2 text
FORM item_record.
Fill BBSEG with no data character .
PERFORM fill_in_nodata_character CHANGING wa_bbseg.
wa_bbseg-stype = '2'.
wa_bbseg-tbnam = 'BBSEG'.
IF NOT it_input-newbs IS INITIAL.
wa_bbseg-newbs = it_input-newbs.
ENDIF.
IF NOT it_input-newko IS INITIAL.
wa_bbseg-newko = it_input-newko.
ENDIF.
IF NOT it_input-newum IS INITIAL.
wa_bbseg-newum = it_input-newum.
ENDIF.
IF NOT it_input-wrbtr IS INITIAL.
wa_bbseg-wrbtr = it_input-wrbtr.
ENDIF.
IF NOT it_input-dmbtr IS INITIAL.
wa_bbseg-dmbtr = it_input-dmbtr.
ENDIF.
IF NOT it_input-zterm IS INITIAL.
wa_bbseg-zterm = it_input-zterm.
ENDIF.
IF NOT it_input-zfbdt IS INITIAL.
wa_bbseg-zfbdt = it_input-zfbdt.
ENDIF.
wa_bbseg-zfbdt = w_budat.
IF NOT it_input-wt_wit IS INITIAL.
wa_bbseg-qsskz = it_input-wt_wit.
ENDIF.
IF NOT it_input-wt_qs IS INITIAL.
wa_bbseg-qsshb = it_input-wt_qs.
ENDIF.
IF NOT it_input-wt_qb IS INITIAL.
wa_bbseg-qsfbt = it_input-wt_qb.
ENDIF.
IF NOT it_input-mwskz IS INITIAL.
wa_bbseg-mwskz = it_input-mwskz.
ENDIF.
IF NOT it_input-bupla IS INITIAL.
wa_bbseg-bupla = it_input-bupla.
ENDIF.
IF it_input-ind IS INITIAL AND NOT it_input-newbk IS INITIAL.
wa_bbseg-newbk = it_input-newbk.
ENDIF.
IF NOT it_input-kostl IS INITIAL.
wa_bbseg-kostl = it_input-kostl.
ENDIF.
IF NOT it_input-aufnr IS INITIAL.
wa_bbseg-aufnr = it_input-aufnr.
ENDIF.
Changes for background processing
IF it_input-newbs NE '34' AND it_input-newbs NE '24'.
IF NOT it_input-prctr IS INITIAL.
wa_bbseg-prctr = it_input-prctr.
ENDIF.
ENDIF.
end of changes.
IF NOT it_input-pernr IS INITIAL.
wa_bbseg-pernr = it_input-pernr.
ENDIF.
IF NOT it_input-zuonr IS INITIAL.
wa_bbseg-zuonr = it_input-zuonr.
ENDIF.
IF NOT it_input-xref1 IS INITIAL.
wa_bbseg-xref1 = it_input-xref1.
ENDIF.
IF NOT it_input-xref2 IS INITIAL.
wa_bbseg-xref2 = it_input-xref2.
ENDIF.
IF NOT it_input-xref3 IS INITIAL.
wa_bbseg-xref3 = it_input-xref3.
ENDIF.
IF NOT it_input-wrbtr IS INITIAL.
wa_bbseg-sgtxt = it_input-sgtxt.
ENDIF.
APPEND wa_bbseg TO it_data.
ENDFORM. " item_record
*& Form post_document
text
--> p1 text
<-- p2 text
FORM post_document.
PERFORM call_rfbibl00.
ENDFORM. " post_document
*& Form upload_file
text
--> p1 text
<-- p2 text
FORM f001_upload_file.
IF pr_serv = 'X'.
MOVE '*' TO w_param_1.
CONCATENATE sy-datum '_' '*' INTO w_param_1.
PERFORM get_file_name USING pr_sfile w_param_1.
CHANGING x_file.
LOOP AT it_file WHERE name CP w_file1.
CLEAR : x_file, w_path,
w_move_file, w_from_dir.
REFRESH : it_input,
it_input_err.
IF w_flag IS INITIAL.
CONCATENATE w_dir it_file-name INTO x_file.
CONDENSE x_file.
TO Move file from sever for backup storing the file name and path
w_path = x_file.
CALL FUNCTION 'TRINT_SPLIT_FILE_AND_PATH'
EXPORTING
full_name = x_file
IMPORTING
stripped_name = w_move_file
file_path = w_from_dir
EXCEPTIONS
x_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.
PERFORM read_file TABLES it_input
USING x_file.
PERFORM next_steps.
CLEAR it_input_err.
REFRESH it_input.
ENDLOOP.
ELSE.
DATA : w_string TYPE string.
w_string = pr_lfile.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = w_string
filetype = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
data_tab = it_input1
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.
LOOP AT it_input1 INTO input_line.
CLEAR: it_input, count.
DO.
ADD 1 TO count.
ASSIGN COMPONENT count OF STRUCTURE it_input TO <fs>.
IF sy-subrc = 0.
SPLIT input_line AT separator INTO <fs> input_line.
ELSE.
EXIT.
ENDIF.
ENDDO.
APPEND it_input.
ENDLOOP.
PERFORM next_steps.
CLEAR it_input_err.
REFRESH it_input.
ENDIF.
ENDFORM. " upload_file
*& Form bdc_header
text
*& Form bdc_dynpro
text
-->P_0956 text
-->P_0957 text
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. " bdc_dynpro
*& Form bdc_field
text
-->P_0961 text
-->P_0962 text
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
IF bdcdata-fval NE space.
APPEND bdcdata.
ENDIF.
ENDFORM. " bdc_field
*& Form bdc_items
text
*& Form fill_in_nodata_character
text
<--P_WA_BBKPF text
FORM fill_in_nodata_character CHANGING p_struc.
FIELD-SYMBOLS: <nodata_field>.
DATA: num TYPE i.
DO.
ADD 1 TO num.
ASSIGN COMPONENT num OF STRUCTURE p_struc TO <nodata_field>.
IF sy-subrc = 0.
<nodata_field> = pr_nodta.
ELSE.
EXIT.
ENDIF.
ENDDO.
ENDFORM. " fill_in_nodata_character
*& Form bdc_bgr00
text
--> p1 text
<-- p2 text
FORM bdc_bgr00.
PERFORM fill_in_nodata_character CHANGING wa_bgr00.
wa_bgr00-stype = '0'.
wa_bgr00-group = pr_group.
wa_bgr00-mandt = sy-mandt.
wa_bgr00-usnam = sy-uname.
wa_bgr00-start = sy-datum.
wa_bgr00-xkeep = pr_xkeep.
APPEND wa_bgr00 TO it_data.
ENDFORM. " bdc_bgr00
*& Form save_on_server
text
--> p1 text
<-- p2 text
FORM save_on_server.
MOVE sy-datum TO w_date.
CLEAR w_file_comp.
w_file_comp = pr_out.
CONCATENATE w_path_comp pr_out c_under w_date c_ext INTO pr_out.
OPEN DATASET pr_out FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT it_data.
TRANSFER it_data TO pr_out.
IF sy-subrc NE 0.
MESSAGE i001(mg) WITH pr_out. " error writing to sequential file
MESSAGE a099(mg). " processing terminated
ENDIF.
ENDLOOP.
CLOSE DATASET pr_out.
FREE it_data.
ENDFORM. " save_on_server
*& Form call_rfbibl00
text
--> p1 text
<-- p2 text
FORM call_rfbibl00.
Submit file after mapping the data to RFBIBL00
SUBMIT rfbibl00 WITH ds_name = pr_out
WITH callmode = callmode
WITH xlog = 'X'
WITH max_comm = pr_max
WITH pa_xprot = 'X'
AND RETURN.
pr_out = w_file_comp.
ENDFORM. " call_rfbibl00
*& Form get_file_name
text
-->P_P_SFILE text
-->P_W_PARAM_1 text
FORM get_file_name USING p_sfile
w_param_1.
CHANGING x_file.
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
client = sy-mandt
logical_filename = p_sfile
parameter_1 = w_param_1
IMPORTING
file_name = x_file
EXCEPTIONS
file_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.
w_path = x_file.
CALL FUNCTION 'TRINT_SPLIT_FILE_AND_PATH'
EXPORTING
full_name = w_path
IMPORTING
stripped_name = w_file
file_path = w_dir
EXCEPTIONS
x_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.
w_dir1 = w_dir.
w_file1 = w_file.
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
dir_name = w_dir1
file_mask = w_file1
TABLES
dir_list = it_file
EXCEPTIONS
invalid_eps_subdir = 1
sapgparam_failed = 2
build_directory_failed = 3
no_authorization = 4
read_directory_failed = 5
too_many_read_errors = 6
empty_directory_list = 7
OTHERS = 8.
IF sy-subrc <> 0.
WRITE : / text-022.
ENDIF.
LOOP AT it_file WHERE name CP w_file1.
IF w_flag IS INITIAL.
CONCATENATE w_dir it_file-name INTO x_file.
CONDENSE x_file.
w_flag = 1.
ELSE.
EXIT.
ENDIF.
ENDLOOP.
ENDFORM. " get_file_name
*& Form read_file
text
-->P_X_FILE text
FORM read_file TABLES it_tab
USING x_file.
OPEN DATASET x_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
WRITE : / text-023.
ELSE.
DO.
READ DATASET x_file INTO input_line.
IF sy-subrc = 0.
CLEAR: it_input, count.
DO.
ADD 1 TO count.
ASSIGN COMPONENT count OF STRUCTURE it_tab TO <fs>.
IF sy-subrc = 0.
SPLIT input_line AT separator INTO <fs> input_line.
ELSE.
EXIT.
ENDIF.
ENDDO.
APPEND it_tab.
ELSE.
EXIT.
ENDIF.
ENDDO.
ENDIF.
CLOSE DATASET x_file.
ENDFORM. " read_file
*& Form validate
text
--> p1 text
<-- p2 text
FORM f002_validate .
SELECT blart
FROM t003
INTO TABLE it_blart.
IF sy-subrc NE 0.
CLEAR it_blart.
ENDIF.
SELECT saknr
FROM ska1
INTO TABLE it_ska1.
IF sy-subrc NE 0.
CLEAR it_ska1.
ENDIF.
SELECT lifnr
FROM lfa1
INTO TABLE it_lifnr.
IF sy-subrc NE 0.
CLEAR it_lifnr.
ENDIF.
SELECT mwskz
FROM t007a
INTO TABLE it_mwskz.
IF sy-subrc NE 0.
CLEAR it_mwskz.
ENDIF.
SELECT qsskz
FROM t059q
INTO TABLE it_qsskz.
IF sy-subrc NE 0.
CLEAR it_qsskz.
ENDIF.
SELECT zterm
FROM t052
INTO TABLE it_zterm.
IF sy-subrc NE 0.
CLEAR it_zterm.
ENDIF.
SELECT bschl
FROM tbsl
INTO TABLE it_bschl.
IF sy-subrc NE 0.
CLEAR it_bschl.
ENDIF.
SELECT umskz
FROM t074u
INTO TABLE it_umskz.
IF sy-subrc NE 0.
CLEAR it_umskz.
ENDIF.
SELECT DISTINCT xblnr
FROM bkpf
INTO TABLE it_xblnr.
IF sy-subrc NE 0.
CLEAR it_xblnr.
ENDIF.
SELECT prctr
FROM cepc
INTO TABLE it_prctr.
IF sy-subrc NE 0.
CLEAR it_prctr.
ENDIF.
SELECT kostl
FROM csks
INTO TABLE it_kostl.
IF sy-subrc NE 0.
CLEAR it_kostl.
ENDIF.
SELECT branch
FROM j_1bbranch
INTO TABLE it_branch.
IF sy-subrc NE 0.
CLEAR it_branch.
ENDIF.
SELECT seccode
FROM seccode
INTO TABLE it_seccode.
IF sy-subrc NE 0.
CLEAR it_seccode.
ENDIF.
SELECT bschl shkzg
FROM tbsl
INTO TABLE it_tbsl.
IF sy-subrc NE 0.
CLEAR it_tbsl.
ENDIF.
SELECT aufnr
FROM aufk
INTO TABLE it_aufnr.
IF sy-subrc NE 0.
CLEAR it_aufnr.
ENDIF.
SELECT pernr
FROM pa0001
INTO TABLE it_pernr.
IF sy-subrc NE 0.
CLEAR it_pernr.
ENDIF.
LOOP AT it_input.
CLEAR : wa_input_err,w_check.
AT NEW xblnr.
CLEAR w_item_no.
ENDAT.
AT NEW xblnr.
CLEAR w_wrbtr.
ENDAT.
w_wrbtr = w_wrbtr + it_input-wrbtr.
*checking the whether record is a header record or not.
IF NOT it_input-ind IS INITIAL.
CLEAR w_item_no.
*keeping the track of item number for error record.
w_item_no = w_item_no + 1.
*Checking the total amount in line item eq 0 or not.
IF w_wrbtr NE 0.
MOVE w_xblnr TO wa_input_err-xblnr.
CONCATENATE wa_input_err-err_text text-019 INTO wa_input_err-err_text SEPARATED BY space.
APPEND wa_input_err TO it_input_err.
ENDIF.
CLEAR : w_xblnr,w_wrbtr.
*Checking whether the record already posted or not.
READ TABLE it_xblnr
WITH KEY xblnr = it_input-xblnr
TRANSPORTING NO FIELDS.
*If record is already posted then al the line items related to that header are moved to
*the error directory saying that record already posted.
IF sy-subrc EQ 0.
MOVE it_input-xblnr TO wa_input_err-xblnr.
MOVE it_input-xblnr TO w_xblnr.
MOVE text-024 TO wa_input_err-err_text.
APPEND wa_input_err TO it_input_err.
*Setting the flag for keeping the track of the posted items.
MOVE 'X' TO w_post.
*Skipping the current record as it is already posted so no validation is done for that record.
CONTINUE.
*If the record is not posted then all the vaidation will be done and depending existanse in check table
*corresponding enrty is moved to the error table.
ELSE.
CLEAR w_post.
MOVE it_input-xblnr TO w_xblnr.
validations for document type
IF NOT it_input-blart IS INITIAL.
READ TABLE it_blart
WITH KEY blart = it_input-blart
TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
MOVE w_xblnr TO wa_input_err-xblnr.
MOVE w_item_no TO wa_input_err-item_no.
MOVE text-018 TO wa_input_err-err_text.
ENDIF.
ENDIF.
*validation for company code
IF pr_bukrs NE it_input-bukrs.
MOVE w_xblnr TO wa_input_err-xblnr.
MOVE w_item_no TO wa_input_err-item_no.
CONCATENATE wa_input_err-err_text text-005 INTO wa_input_err-err_text SEPARATED BY space.
ENDIF.
*validation for currency
IF pr_waers NE it_input-waers.
MOVE w_xblnr TO wa_input_err-xblnr.
MOVE w_item_no TO wa_input_err-item_no.
CONCATENATE wa_input_err-err_text text-006 INTO wa_input_err-err_text SEPARATED BY space.
ENDIF.
*validation for GL account number
IF NOT it_input-newko IS INITIAL.
MOVE it_input-newko TO w_newko.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = w_newko
IMPORTING
output = w_newko.
READ TABLE it_ska1
WITH KEY saknr = w_newko
TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
READ TABLE it_lifnr
WITH KEY lifnr = w_newko
bukrs = it_input-newbk
TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
MOVE w_xblnr TO wa_input_err-xblnr.
MOVE w_item_no TO wa_input_err-item_no.
CONCATENATE wa_input_err-err_text text-029 INTO wa_input_err-err_text.
ENDIF.
ENDIF.
ENDIF.
**validation for vendor account number
IF NOT it_input-newko IS INITIAL.
MOVE it_input-newko TO w_newko.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = w_newko
IMPORTING
output = w_newko.
READ TABLE it_lifnr
WITH KEY lifnr = w_newko
TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
MOVE w_xblnr TO wa_input_err-xblnr.
MOVE w_item_no TO wa_input_err-item_no.
CONCATENATE wa_input_err-err_text text-029 INTO wa_input_err-err_text SEPARATED BY space.
ENDIF.
ENDIF.
*validation for taxcode
IF NOT it_input-mwskz IS INITIAL.
READ TABLE it_mwskz
WITH KEY mwskz = it_input-mwskz
TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
MOVE w_xblnr TO wa_input_err-xblnr.
MOVE w_item_no TO wa_input_err-item_no.
-
Interface errors (crc, in/output, collisions etc.) via snmp
Hi,
I'm trying to understand how to get interface errors via SNMP. I do get stats via SNMP for ifInErrors / ifOutErrors etc, but I'm trying to get output via SNMP for the errors visible via the 'sh int x' command - CRC errors, input / output errors, collisions, runts. giants etc.).
1) The SNMP ifInError / ifOutError seems to give an overall counter of all errors from the time the device has started - Am I correct about this?
2) Is there any way I can get the interface-specific errors noted above via SNMP?
Thanks,
MarioDepends on the device and version of code, but most likely you will get what you want from the CISCO-IF-EXTENSION-MIB. Look at objects like cieIfInRuntsErrs, cieIfInGiantsErrs, and cieIfInFramingErrs. You will also get some ethernet-specific errors from the ETHERLIKE-MIB.
-
Is there an script that can monitor interface errors (input and output errors) and send an email out when it reaches threshold?
Thanks
Sent from Cisco Technical Support iPhone AppSure. Here's an example:
event manager applet error_monitor_GigabitEthernet0/1
event interface name GigabitEthernet0/1 parameter input_errors entry-op ge entry-val 5 entry-type increment poll-interval 10
action 2.0 cli command "enable"
action 3.0 cli command "show int GigabitEthernet0/1 | inc error"
action 4.0 mail server 10.1.1.1 from [email protected] to [email protected] subject "Errors on interface GigabitEthernet0/1" body "
Interface GigabitEthernet0/1 has seen $_interface_delta_value input errors in the past 10 seconds: $_cli_result" -
Open DeviceNet interface error when TestStand call VIs of NI PCI-8532
Hello,
We use NI PCI-8532 was used as DeviceNet master to do functionality test with a slave (AC Drive).
But when open DeviceNet interface, it happen the error.
We can't find the solution and hope to find help from you.
The basic sequence in TestStand is:
1). Call "Open DeviceNet Interface.vi" to open interface and creat interface object.
Interface(master) setting: interface name=dnet0, MAC ID=0, baudrate=125000bps
2). Call "Open DeviceNet IO.vi" to creat DeviceNet IO object.
Device(slave) setting: MAC ID=63
3). Call "Operate DeviceNet Interface.vi" and operation code=start
4). Call "Wait For State.vi"
5). Call "Read DeviceNet IO.vi" to read data from IO object
6). Call "Close Object.vi" to close IO object handle
7). Call "Close Object.vi" to close interface object handle
Remark, these DeviceNet VIs locates at "C:\Program Files\National Instruments\LabVIEW 2012\vi.lib\DeviceNet\VIAPI".
First time to run sequece in TestStand, it can pass to run step 1) to open DeviceNet interface.
But once there is some error with these steps, and it will happen "Open DeviceNet Interface" error (error code=0xBFF62006) when run these steps again.
Then even use LabVIEW DeviceNet example to test, and it happen the same error except restart computer.
The DeviceNet example locates at "C:\Program Files\National Instruments\LabVIEW 2012\examples\NI-Industrial Communications for DeviceNet\Basic Examples\PXI & PCI\MixedCommunication.vi".
Some information more:
PC operate system: Windows XP SP3
LabVIEW version: 2012 SP1
TestStand version: 2012 SP1
PCI 8532 driver version: 2.3.0
Other installed PCI board: PCI 8531 CANOpenThe following errors may be resolved by resetting the CAN, DeviceNET or LIN device:
Error -1074388986 occurred at ...
NI-CAN: (Hex 0xBFF62006) The object is already open in another application. Solutions: Ensure that only one application at a time uses an object , and that you close all objects prior to exiting your application (don't use LabVIEW toolbar's Abort button).
Error -1074388969 occurred at ...
NI-CAN: (Hex 0xBFF62017) This attribute's value must be provided prior to the Open. Solutions: Set the attribute using the Config function before the Open, and do not set the attribute at any later time; Do not configure multiple CAN Objects for the same ID.
SO,you should reset the DeviceNet.
And another similar issue can explain some points of your problem http://digital.ni.com/public.nsf/allkb/7D9383E9BEAD0B21862571640002F687?OpenDocument -
Internal error [/SAPAPO/OM_TS_TGRID_CREATE]
Hi All,
I am using BAPI BAPI_PBSRVAPS_GETDETAIL to read live cache key figure. Its working finr when I execute the program in foreground and returns values but when I try executing this is background it gives me following error in Job Log:-
Internal error [/SAPAPO/OM_TS_TGRID_CREATE].
Can somebody suggest me the root cause and remedy for the same. I try doing planning area initializationa and live cache consistency check also but no luck.
A timely reply will be highly appreciated.
Thanks !
Regards,
ChandanHi Chandan,
I checked and found no sap notes similar to scm 4.0. I would suggest to raise a OSS message to SAP so that they will advise on suitable support pack or sap note to implement.
Regards
R. Senthil Mareeswaran. -
Error while creating a product group--Batch input error 9
Hi,
While creating a product group in T-code MC84, getting the error message" Product group can not be created (Batch input error 9)". Would appreciate providing yr help to resolve above issue.
Thks,
NileshHi Neel,
As ponited by you, the material type "PROD" is realted with creation of product group.I am able to resolve the error, "actually the work schedulling & MRP views were not activated for "PROD" resulting in the above error.
Thks for yr help.
Regards,
Nilesh -
Can't burn CD's - "Interface error 5"
Hello, I haven't used my old firewire LaCie CD burner (LaCie 1394, blue front with the slide out tray) in a while but recently I needed to put some graphics files on a CD. The sw I'm using is Toast 6. No matter what I tyry to do I get the following message: "Interface Error: 5 The connection is not stable"
I tried different CD brands, no effect.
This is the setup.
Machine Name: Power Mac G4 Cube
Machine Model: PowerMac5,1
CPU Type: PowerPC 60? (1.1)
CPU Speed: 1.3 GHz
L2 Cache (per CPU): 512 KB
L3 Cache (per CPU): 2 MB
Memory: 1.25 GB
Bus Speed: 100 MHz
Boot ROM Version: 4.1.9f1
System Version: Mac OS X 10.4.2 (8C46)
Kernel Version: Darwin 8.2.0
Looking for answers I found an (unanswered) message on a macosx.com forum. I'm reposting it because it provides more info about the same problem:
[quote]
"Burning the disc failed because communication to the disc drive failed. (Error code 0x80020022)" -- Is the error code when I attempt to burn any disc using the Finder or Disk Utility.
"Interface Error: 5 The connection is not stable.
The drive reported an error:
Sense Key = Illegal Request
Sense Code = 0x210x02
BUFFER UNDERRUN" --
Are the errors when I attempt to use Toast Titanium v6.x and v7.x.
I'm using an iMac G5 running 10.4.2. I have two burners, both of which give me the errors and will no longer burn to CD's or DVD's (cheap or expensive media, I've tried many different types). The burners i have are an internal superdrive that came with the mac (MATSHITA DVD-R UJ-825) and an external LaCie Firewire DL drive (_NEC DVD_RW ND-3500AG). Both drives started giving this error at the same time and I can't think of anything that I installed that could effect these. I don't have any speed tools installed.
I have tried all that Apple suggests in the articles http://docs.info.apple.com/article.html?artnum=25750.
I've experienced the same errors twice before, though not both drives at the same time. What fixed it the first time was simply upgrading the firmware on the burner. Second time, there were problems on the hard drive that I was burning from (directory issues if i remember) and running a combination of Tech Tool and Disk Utilitity fixed that.
But this time, I'm at my wits end and can't find anything helpful online. I'm hoping to find an answer before I end up trying a complete system reinstall.
Any info would be greatly appreciated.
[/quote]
Yes, any info ...
TIA
Cube, 2 ibooks Mac OS X (10.4.2)I'm having the same problem using Toast 7 to burn a Video TS movie I made. I'm using an external Lacie 16X DVD-R DL drive and an iMac G5 2.0, and Mac OS 10.4.3
After several failures with Interface Error 5, I tried copying a DVD movie I made from another DVD. This was created with the same Lacie drive using Mac OS 10.3 and my old iMac FP 15 inch. I got the same failure message.
I then switched my Lacie Drive to the USB port and everything is working fine. I switched it back to FireWire and I get the same error message again.
I can play DVD's on the Lacie with either the USB or FireWire port without any problem, I just can't record using the FireWire port. The FireWire ports on the computer work fine with all my other FireWire devices.
It must be a combination of 10.4.3, Toast 7 and Lacie FireWire. I'm going to recheck Lacie's site to make sure I have all of the updates.
iMac G5 Mac OS X (10.4.2) Mac OS 10.4.3 -
EEM interface errors not matching
I have the event applet configured below. I test by changing the controller time-slots to 1-15 instead of 1-24 in order to generate errors on my Serial0/1/0:0 interface. Errors are generated, but the eem applet does not match even though the errors are incrementing. I've turned on all suggested eem debugging and it shows 0 matches while I can see that the interface is incrementing the errors that should be triggering the actions from the eem.
configuration:
event manager applet multiple_if
event tag if_1 interface name Serial0/1/0:0 parameter input_errors_crc entry-op ge entry-val 2 entry-type increment poll-interval 60
event tag if_2 interface name Serial0/1/0:0 parameter input_errors entry-op ge entry-val 2 entry-type increment poll-interval 60
event tag if_3 interface name Serial0/1/0:0 parameter input_errors_frame entry-op ge entry-val 2 entry-type increment poll-interval 60
event tag if_4 interface name Serial0/1/0:0 parameter input_errors_overrun entry-op ge entry-val 2 entry-type increment poll-interval 60
event tag if_5 interface name Serial0/1/0:0 parameter output_errors entry-op ge entry-val 2 entry-type increment poll-interval 60
event tag if_6 interface name Serial0/1/0:0 parameter output_errors_underrun entry-op ge entry-val 2 entry-type increment poll-interval 60
trigger
action 100 cli command "enable"
action 200 cli command "config t"
action 300 cli command "int Serial0/1/0:0"
action 400 cli command "description script worked!"
action 500 syslog msg "CRC failure leased line $_interface_name"
action 600 mail server "$_mail_smtp" to "$_mail_rcpt" from "$_info_routername@$_mail_domain" subject "ALERT: Serial Interface $id shutdown due to excessive interface error rate" body "\n$_syslog_msg"
action 999 end
debug ouput:
Jun 20 14:20:48 EDT: fh_fd_syslog_event_match: num_matches = 0
Jun 20 14:20:48 EDT: fh_fd_data_syslog: num_matches = 0
Jun 20 14:20:48 EDT: fh_fd_syslog_event_match: num_matches = 0
Jun 20 14:20:48 EDT: fh_fd_data_syslog: num_matches = 0
Jun 20 14:21:00 EDT: fh_fd_timer_process_async
Jun 20 14:21:00 EDT: cron_tick: num_matches 0
Jun 20 14:21:22 EDT: %HSRP-5-STATECHANGE: FastEthernet0/0.4 Grp 4 state Standby -> Active
Jun 20 14:21:22 EDT: fh_fd_syslog_event_match: num_matches = 0
Jun 20 14:21:22 EDT: fh_fd_data_syslog: num_matches = 0
Jun 20 14:22:00 EDT: fh_fd_timer_process_async
Jun 20 14:22:00 EDT: cron_tick: num_matches 0
Jun 20 14:23:00 EDT: fh_fd_timer_process_async
Jun 20 14:23:00 EDT: cron_tick: num_matches 0
Jun 20 14:24:00 EDT: fh_fd_timer_process_async
Jun 20 14:24:00 EDT: cron_tick: num_matches 0
output showing interface errors:
csc-lab01#sh int s0/1/0:0
Serial0/1/0:0 is up, line protocol is up
Hardware is GT96K Serial
Internet address is x.x.x.x/30
MTU 1500 bytes, BW 1536 Kbit/sec, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, LCP Open
Listen: CDPCP
Open: IPCP, loopback not set
Keepalive set (10 sec)
CRC checking enabled
Last input 00:00:00, output 00:00:00, output hang never
Last clearing of "show interface" counters 02:44:23
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: Class-based queueing
Output queue: 0/1000/0 (size/max total/drops)
30 second input rate 2000 bits/sec, 3 packets/sec
30 second output rate 2000 bits/sec, 2 packets/sec
9139 packets input, 1049231 bytes, 0 no buffer
Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
224 input errors, 224 CRC, 117 frame, 95 overrun, 0 ignored, 81 abort
10737 packets output, 1511507 bytes, 0 underruns
0 output errors, 0 collisions, 15 interface resets
0 unknown protocol drops
0 output buffer failures, 0 output buffers swapped out
0 carrier transitions
Timeslot(s) Used:1-24, SCC: 0, Transmitter delay is 0 flagsA few other things I noticed. Try this:
event manager applet multiple_if
event tag if_1 interface name Serial0/1/0:0 parameter input_errors_crc entry-op ge entry-val 2 entry-type increment poll-interval 60
event tag if_2 interface name Serial0/1/0:0 parameter input_errors entry-op ge entry-val 2 entry-type increment poll-interval 60
event tag if_3 interface name Serial0/1/0:0 parameter input_errors_frame entry-op ge entry-val 2 entry-type increment poll-interval 60
event tag if_4 interface name Serial0/1/0:0 parameter input_errors_overrun entry-op ge entry-val 2 entry-type increment poll-interval 60
event tag if_5 interface name Serial0/1/0:0 parameter output_errors entry-op ge entry-val 2 entry-type increment poll-interval 60
event tag if_6 interface name Serial0/1/0:0 parameter output_errors_underrun entry-op ge entry-val 2 entry-type increment poll-interval 60
trigger occurs 1
correlate event if_1 or event if_2 or event if_3 or event if_4 or event if_4 or event if_5 or event if_6
action 100 cli command "enable"
action 200 cli command "config t"
action 300 cli command "int Serial0/1/0:0"
action 400 cli command "description script worked!"
action 401 set syslog_msg "CRC failure leased line $_interface_name"
action 500 syslog msg "$syslog_msg"
action 501 info type routername
action 600 mail server "$_mail_smtp" to "$_mail_rcpt" from "$_info_routername@$_mail_domain" subject "ALERT: Serial Interface $_interface_name shutdown due to excessive interface error rate" body "\n$syslog_msg" -
Pro Ver 6 Batch Processing Error
When running batch processing on .doc files, at the end of the run the batch processor errors and warnings window shows a "bad parameter" message for each document. But it does not say what the bad parameter is. I can successfully convert the same document manually, so not sure what to do. The log file is no help, as that just contains the same error messages. Running version 6.0.6 of Acrobat Pro, WinXP Pro and Office 2003. The documents are all single page Word files with an embedded .tif file. The manually converted .pdf files look fine.
hi TAJ0808,
there is a fix for it go and ask support we already have it installed.
regards chris -
Error /SAPAPO/TSM 041 when loading from InfoCube to SNP planning area
I am using APO V5.1.
I have a 'backup' InfoCube with characteristics 9ARNAME and 9AVERSION which I'm loading to an SNP planning area via trans /SAPAPO/TSCUBE. The InfoCube is itself populated from the 9ARE aggregate of the SNP planning area.
But I get error /SAPAPO/TSM 041when I run the load, suggesting absence of a required characteristic or navigation attribute in the Cube. Do I need 9ALOCNO for instance?
Can anyone advise me here?...Hi,
I am not very sure about the 9ARE aggregate (haven't used it in backups), but RTSCUBE is used to copy time Series (TS) KF data from cube to planning area (SNP or DP).
Are you trying to restore some time series data from your backup cube to the planning area? If yes, then do a mapping of characteristic from cube to planning area in RTSCUBE, and also map the TS KF between cube and planning area.
If your KF is not a time series KF, then you can't copy it from cube to planning area. You could get data to cube for some reporting, otherwise I am not sure what use the backup is for you. For SNP, most of the data would be received from R/3, so there's not much point in having a backup.
Hope this helps.
Thanks - Pawan -
Can we set the Option "Show add-in user interface errors" with VBA?
Does anyone know if the advanced Option "Show add-in user interface errors" can be set with VBA in Project Pro 2013?
\Spiro Theopoulos, Montreal, QC (Canada)Spiro,
Sorry but as far as I know that option is not available through VBA.
John -
Help: Net.lib interface error
Hi!
I'm using the Palm Emulator to make a HTTP connection to my servlet. The same MIDlet works on my Palm, but when I run it on the emulator (in order to some screen captures), I get error mesg that says "Net.lib interface error: 0x0000120C", followed by java.io.IOException.
I've already set my proxy IP ...
Can someone pls help? TIA!
RgdsHi ....
Is anyone have any ideas to solved if this problem occur on the real palm m505 machine ??
Please advice and kindly reply
Thank
SL
Maybe you are looking for
-
HOW CAN I TRANSFER PHOTOS FROM MY IPOD TOUCH TO MY PC BUT THESE PHOTOS ARE NOT IN THE SAVED POTHOS FOLDER. THEY ARE IN SEPARATE AND DIFFERENT FOLDERS THAT MY DAUGTHER SAVED FROM HER PC. IS THERE ANY FREE WAY TO DO IT. PLEASE REPLY TO JUMACAVA07@HOTMA
-
Nokia 5800 connected to WLAN but can't browse the ...
wassup! peeps. recently I can't browse the web or use any free messaging apps such as Nimbuzz on my nokia 5800 (fw version 21.0) finland made, but clearly indicates that it's connected to WLAN...the ones I used before (in my home & @ my work). I noti
-
When I want to watch the learning videos in adobe tv there is only a black square. Do I need to install something.?
-
Creating Dll with Vision Library
Greetings Board Members, I have a small Application For which i want to make a shared DLL and test them before deploying at other co worker computer, The application uses the Labview Vision, The DLL are made by Building the DLL. When I use the same d
-
How to run the 9I report from the forms menue 9i
how to run the 9I report from the forms menue 9i. Shehzad Latif