LSMW - RFBIBL00 background ko
HEllo !
i met problem by loading data by LSMW direct-input in background.
i use the standard program /SAPDMC/SAP_LSMW_INTERFACE.
and the last step (running RFBIBL00) fails in background mode only (it works well on foreground).
by SM37 i got the error message E078 (BD class) : "data does not match job definition".
i think that RFBIBL00 program is in the cause...
did anyone already have this problem?
thanks
dev
The message long text:
NA BD078
Text
Job &: Data does not match the job definition; job terminated
Diagnosis
You wanted to start a direct input job. The system has found that the data does
not match the data from the job definition.
System Response
The system terminated the job.
Procedure
Start the job from the Manage Data Transfers (Direct input) screen, where you can
also schedule the job periodically.
Proceed
Rob
Similar Messages
-
In the LSMW RFBIBL00 Background error ?
Hi Friends,
I am using rfbibl00 to create batch input session for FI data upload .
My poblem is Session can b pricessd successflly in forground . But when I submit it to back ground ,
it goes into error .
ZGL_BALANCE_HEADER G/L Balance Header
BLDAT C(008) Document Date
BUDAT C(008) Posting Date
BLART C(002) Document Type
BUKRS C(004) Company Code
WAERS C(005) Currency
MONAT C(002) Posting Period
WWERT C(008) Date (batch input)
XBLNR C(016) Reference Document number
BKTXT C(025) Document Header Text
KURSF C(010) Exchange rate
ZGL_BALANCE_ITEM G/L Balance Load Item
BUKRS C(004) Company Code for the Next Line Item
NEWBK C(004) New company code
NEWBS C(002) Posting Key for the Next Line Item
DUMMYX C(010) General Ledger Account
MWSKZ C(002) Sales Tax Code
TXJCD C(015) Tax Jurisdiction
WRBTR C(016) Amount in document currency (batch input field)
KOSTL C(010) Cost Center
AUFNR C(012) Order Number
PROJK C(008) No longer use this field (use PROJK)
PRCTR C(010) Profit Center
NPLNR C(012) Network Number for Account Assignment
VBEL2 C(010) Sales Document
EBELN C(010) Purchasing Document Number
MENGE C(017) Quantity (Batch Input Field)
PERNR C(008) Personnel Number (Batch Input Field)
MATNR C(018) Material Number
ZUONR C(018) Assignment Number
SGTXT C(050) Item Text
In the above structure have BUKRS and NEWBK is the key field.
But it is working in foreground .
Whenever it is in Background the below message are getting .
Error message : ---
Session ZGL_BALANCE_ is being processed by user NAGPATIL in mode N on server ptg-mrbsapdev 0
Field RF05A-NEWBK. does not exist in the screen SAPMF05A 0100 FB01 1
Transaction error FB01 1
Processing statistics 0
1 transactions read 0
0 transactions processed 0
1 transactions with errors 0
0 transactions deleted 0
Batch input processing ended 0
Thanking you.
SubashHello,
The issue seems to be that your vendor reconciliation account is not tax
relevant while the invoice comes with a tax code. You can check the G/L
account master data and make sure there is an entry in the tax category,
master data and make sure there is an entry in the tax category.
If you sometimes don't want to enter a tax code for this vendor you
can set the flag "Posting without tax allowed" in addition.
Try the following to analyze this error:
- set the flag for "Create BDC session" in tx OBCE
- check the settings in OBCB (see SAP note 150120)
- process the error idoc again
- goto tx SM35 and process the batch input session from the idoc (IV...)
in the foreground step by step until you get the message that this
field for the discount base is not there
- then, check if the vendor account is the right one
- check if the field status of this vendor's reconciliation account
is correct. In the section payment the payment terms must be ready for
input (optional field).
Regards,
David -
LSMW RFBIBL00 withholding tax base amount in local currency cannot be updated by manual
Hi SAP Guru,
When I try to upload FI docs by program RFBIBL00 in LSMW, the field BWITH-WT_QSSHH(withholding tax base amount in local currency) cannot be updated.
(1) The LSMW structure is defined as bellow:
BGR00<--------DOC_HEAD
BBKPF<--------DOC_HEAD
BBSEG<--------DOC_ITEM
BWITH <--------DOC_WHTX
And fields in structure BWITH are defined as bellow:
Field Name
Type
Length
Field Description
STYPE
C
1
Batch Input Interface Record Type
WITHT
C
2
Withholding tax type
WT_WITHCD
C
2
Withholding tax type
WT_QSSHB
C
21
W/tax base amount in document currency (batch input
field)
WT_QSSHH
C
21
W/tax base amount in Local currency (batch input
field)
(2) When I run LSMW, the doc can be posted successfully. All the information can be updated as the data I upload. Only the field WT_QSSHH is calculated by system automatically according to the current foreign exchange rate.
(3) When I try to post this doc by manual(F-02), the field WT_QSSHH is not editable.
How can I change the field WT_QSSHH into editable and update this field in LSMW RFBIBL00.
Thank you very much!
EricHi Nikitha,
I tried posting an invoice in currency other then co. code currency, but the WT amount is getting calculated perfectly.
also checked vendor with foreign curr recon account. the WT is working for that also
Can you please share the screen shot of the transaction where after changing currency you are not getting the values picked up for WT
May be i have not understood your questions
Regards
Pragya -
Hi friends,
I need some information. Is it possible to run an LSMW in Background. If so which type of programs we can run in Background which types are not?
Regards,
Naren.hello all,
Regarding Session method :
in Run Batch Input session, we can use foreground or background.
Direct input:
Create Material with transaction BMV0
Go to transaction SE38, choose the program RMDATIND and create a variant (direct relation to the run; Exp. Creation of the MRP view. Choose the appropriate entries in the following screen and save the variant.
Click in the BMV0 on this button then you get to this screen. Create a entry with you Variant name and save it.
Important: Check in the P-System if you can create a entry in this table!!
After the definition, choose the button .
Check the Job with TA: SM37
This screen appears if you start the MBV0 from the LSMW
Just press F8 to continue. You will get to this screen.
This transaction gives you a Job log, protocol and also the possibility to restart a job in case of errors.
reg,
P_sonar -
LSMW in background mode not working properly
Hi,
I am doing LSMW in background mode. But I am facing problem in SM35. The session is ended with sessions.
Wt I am trying to do here is: I have 4 fields on the screen in which 4 th field is non-editable field.
I am concatenating first 3 fields and storing in 4th field and storing in a table.
In the foreground ..I have no problems. LSMW is working properly and there no logs in SM35.
But however if i run the session in background, It is showing as 4th field is not a input field.
ThanksThis is the output of journalctl --all
May 12 20:55:04 egidiolaptop /usr/lib/gdm/gdm-x-session[19552]: Activating service name='org.gnome.Terminal'
May 12 20:55:04 egidiolaptop /usr/lib/gdm/gdm-x-session[19552]: Successfully activated service 'org.gnome.Terminal'
May 12 20:55:26 egidiolaptop gnome-session[19563]: 1431456926458 addons.update-checker WARN Update manifest for {972ce4c6-7e08-4474-a285-3208198ce6fd} did not contain an updates property
May 12 20:56:03 egidiolaptop systemd[19544]: [/home/egidio/.config/systemd/user/googledrive.service:2] Unknown lvalue 'Type' in section 'Unit'
May 12 20:56:03 egidiolaptop systemd[19544]: Cannot add dependency job for unit network-online.target, ignoring: Unit network-online.target failed to load: No such file or directory.
May 12 20:56:03 egidiolaptop systemd[19544]: Created slice -.slice.
May 12 20:56:03 egidiolaptop systemd[19544]: Starting -.slice.
May 12 20:56:03 egidiolaptop systemd[19544]: Started Google Drive mount.
May 12 20:56:03 egidiolaptop systemd[19544]: Starting Google Drive mount...
May 12 20:56:03 egidiolaptop fusermount[20547]: /usr/bin/fusermount: failed to unmount /home/egidio/Google Drive: Device or resource busy
May 12 20:56:03 egidiolaptop systemd[19544]: googledrive.service: control process exited, code=exited status=1
May 12 20:56:03 egidiolaptop systemd[19544]: Unit googledrive.service entered failed state.
May 12 20:56:03 egidiolaptop systemd[19544]: googledrive.service failed. -
LSMW RFBIBL00 using only one file
Hello everyone,
I am creating an LSMW for post documents. My input file is so far given by an legacy system.
I have one file, which contains the accounting transactions.
One accounting transaction is distributed over more than one line in my input file. So you have one debtor account and many contra-entries.
My problem is, that every line has header data (debtor and contra-entry), so I have no idea how to tell my LSMW that there has to be a new line item instead of a new document.
I hope anybody can help
Best regards
PatrickHi Patrick,
In LSMW RFBIBL00, where you want to upload transaction data, you generally have two files.. One for header data and the other for Line item data.
In the Header Data, there is a field called link, say for example it is (1) and it will have other data like Date, Posting key, Currency etc.. (BKPF data)
In the Line item file, also the field Link will have (1) and in fact this link will dictate when a new document is to be posted.. say for example this particular document has 5 line items to be posted. Then all the line items will have the same link (1)
and the debit and credits should match to Zero. When this matched a document is posted..Then again the second line in header file will have link (2) and again the line item file will have multiple line items all having link (2) so the second document will get posted.
In short, system will pick up the link No. from the header file and look for all line items in line item file and match the debits and credit to Zero to post a document, the moment it finds a new Link No., it will post a new Document No.
Regards,
SAPFICO -
Dear All,
I've a requirement wehere i've to process the LSMW in background, the recording is not possible through SHDB as it gives error & exit out.
Please let me know the method where i can execute the LSMW with all internal step in background.
Let me know the steop & procedure to execute the above
Thanxs in advanceDear Sanjeev,
If you are choosing SESSION method for migrating data using LSMW, in the 13 step you create SESSION, for precessing session you execute 14 th step then it will automatically place cursor in SM35( SESSION) here you follow these steps.
1) select the SESSION which was you created.
2) here you find option for processing SESSION, from that you choose BACKGROUND.
3) it willl display screen with required field, like date, time.
or
The LSMW usually has 3 or 4 steps of execution:
1) Read Data
2) Convert Data
3) Generate a Session / Process the converted file or session (These two are separate steps for a LSMW with BDC session).
If you want to schedule a job:
A) The first two steps need the Files on Application Server. You must use App Server files in the Specify Files and Assign Files steps.
B) The LSMW should preferably not be BDC session based. You will lose the benefit of scheduled processing, as the LSMW and Session will be two separate schedules. Sychronizing these and tracking the Sessions may be difficult.
C) You need to note down the ABAP program names for the three steps and create the relevant variants.
D) Then, schedule the three programs in a single job in that sequence.
or
You can run/schedule program /SAPDMC/SAP_LSMW_INTERFACE for scheduling any LSMW object as a job.
Regards,
Naveen. -
Problem with LSMW - RFBIBL00 "FI_INVOICES: No terminations have been found"
Hi experts,
Hope you can help me.
I'm trying to load open invoices into SAP from a legacy system using LSMW. I defined all the structures and finished all the step but didn't load any data. I looked at the converted data and everything looks Ok.
This is the log:
FB018 File P2P_GRANITE_VENDORS_FI_INVOICES.lsmw.conv is being checked
FB012 Session 1 : Special character for 'empty field' is /
FB019 Session 1 session name FI_INVOICES : No terminations have been found
Following further information about the LSMW:
Object: 0100
Method: 0000
Program: RFBIBL00
Program Type: D
Source structures (linked by CNT field)
INV_HEAD:
Company Code (BUKRS), Fiscal Year (GJAHR), Document Type (BLART), Posting Date (BUDAT), Document Date (BLDAT), Document Header Text (BKTXT), Reference Document Number (XBLNR), Currency Key (WAERS), Count (CNT)
INV_ITEM
Posting Key for the Next Line Item (NEWBS), Account or Matchcode for the Next Line Item (NEWKO), Amount in document currency (WRBTR) , Baseline Date (ZFBDT), Cash Discount Days 1 (ZBD1T), Item Text (SGTXT), Count (CNT)
Document Type ZC or KR
Posting Key 31 and 40
Thanks in advance,
Mairo.It looks everything fine for me.. what is ther exact error message are you getting..
However also go through my book on LSMW, it may help you.
http://www.4shared.com/document/wkl5vHpv/LSMW_SATISH.html
Satish -
LSMW /RFBIBL00 CO-PA trouble
Hello All,
I try to load P&L account into FI-GL using LSMW and RFBIBL00.
For some accounts, I have to load CO-PA charcteristics values.
I did it into the mapping and relation structure, but the system doesn't write it. When I do the transaction FB01, I see there is on field to call CO-PAs screen : DKACB-FMORE.
How can i add it or what i have to do on my lsmw transaction to obtain the same result ?
Thanks for your answer,
Best Regards
PhilippeI'm trying to do the same thing. My COPABBSEG structure does have all the COPA characteristics, but the COPA fields are not filled.
When I execute the batch input, there's an indicator field on the screen XERGO, "Detail screen for profitability segment". I cannot find this field in the BSEG table. Could that be the problem ?
Kind regards,
Rianne -
How to schedule lsmw in background
hai all,
can any one tell me how can lsmw for a transaction can be background scheduled.use the program /sapdmc/sap_lsmw_interface.
create a variant with your project name, sub project name, etc..
you can schedule this program for background execution...
else, can call it from another program..
just pseudocode...
L_JOBNAME = some name for job. "'PURCHASEINFODL'.
L_SELECTION_SET = your variant name . " 'PURCH_INFO_DEL'.
CONCATENATE L_JOBNAME SY-UNAME SY-DATUM
INTO L_JOBNAME SEPARATED BY '_'.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
JOBNAME = L_JOBNAME
IMPORTING
JOBCOUNT = L_JOBNO
EXCEPTIONS
CANT_CREATE_JOB = 1
INVALID_JOB_DATA = 2
JOBNAME_MISSING = 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.
ELSE.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
* DESTINATION = 'KJAT'
DESTINATION = SY-PDEST
COPIES = 0
IMMEDIATELY = ' '
RELEASE = ' '
NEW_LIST_ID = 'X'
LINE_SIZE = '255'
LINE_COUNT = '65'
SAP_COVER_PAGE = ' '
COVER_PAGE = ' '
RECEIVER = SY-UNAME
NO_DIALOG = 'X'
IMPORTING
OUT_PARAMETERS = PRINT_PARAMETERS.
SUBMIT /SAPDMC/SAP_LSMW_INTERFACE
USING SELECTION-SET L_SELECTION_SET
TO SAP-SPOOL
SPOOL PARAMETERS PRINT_PARAMETERS
WITHOUT SPOOL DYNPRO
VIA JOB L_JOBNAME NUMBER L_JOBNO
AND RETURN.
IF SY-SUBRC = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = L_JOBNO
JOBNAME = L_JOBNAME
STRTIMMED = 'X'
EXCEPTIONS
CANT_START_IMMEDIATE = 1
INVALID_STARTDATE = 2
JOBNAME_MISSING = 3
JOB_CLOSE_FAILED = 4
JOB_NOSTEPS = 5
JOB_NOTEX = 6
LOCK_FAILED = 7
INVALID_TARGET = 8
OTHERS = 9.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
MESSAGE ID 'BT' TYPE 'I' NUMBER 156 WITH L_JOBNAME.
ENDIF.
ENDIF.
WHILE BJOB_FINISHED IS INITIAL.
WAIT UP TO 1 SECONDS.
CALL FUNCTION 'BP_JOB_CHECKSTATE_SM37B'
EXPORTING
DIALOG = 'N'
JOBCOUNT = L_JOBNO
JOBNAME = L_JOBNAME
OK_JOB = 0
NOT_OK_JOB = 0
IMPORTING
* STATUS_ACCORDING_TO_DB = L_JOBSTATUS
ACTUAL_STATUS = L_JOBSTATUS
* OK_JOB =
* NOT_OK_JOB =
EXCEPTIONS
CHECKING_OF_JOB_HAS_FAILED = 1
CORRECTING_JOB_STATUS_FAILED = 2
INVALID_DIALOG_TYPE = 3
JOB_DOES_NOT_EXIST = 4
NO_CHECK_PRIVILEGE_GIVEN = 5
READY_SWITCH_TOO_DANGEROUS = 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.
ELSE.
CASE L_JOBSTATUS.
WHEN 'F'.
MOVE 'F' TO BJOB_FINISHED.
MESSAGE I903. " WITH TEXT-R07.
WHEN 'R'.
CLEAR BJOB_FINISHED.
WHEN 'C'.
MOVE 'C' TO BJOB_FINISHED.
MESSAGE I904. " WITH TEXT-R08.
WHEN 'A'.
MOVE 'A' TO BJOB_FINISHED.
MESSAGE I904. " WITH TEXT-R08.
WHEN OTHERS.
CLEAR BJOB_FINISHED.
ENDCASE.
ENDIF.
ENDWHILE. -
LSMW + RFBIBL00 + PA
Hello All,
I try to load P&L account using LSMW with program RFBIBL00.
I need to load PA charcteristics values for some accounts.
- DOCUMENTATION: With effect from Release 3.0D, you can also enter the characteristics from profitability analysis in the BBSEG structure. Program RFBIBL00 will then automatically generate a batch input session for FB01 with account assignment to the profitability segment (including assigning the profitability segment number, deriving characteristics and all validations that also take place during online posting).
I filled the relation structure BBSEG with the fields I need, but the BI generated doesn't contain the dynpros and fields to load the PA characteristics.
I need to fill a flag to activate this? or something like that?? if this program is prepared to load PA, why it doesn't work? what i'm doing wrong?
Thanks for your answer,
Best Regards
PatriciaHi Max,
Yes, I have filled my PA characteristics
- Field Mapping --> BBSEG structure
RKE_VTWEG
RKE_WWFAM
and if I debugg the program RFBIBL00 (when conversion) I can see the corresponding moves for this elements, but the program doesn't generate the dynpros to load the PA characteristics and I dont't know if I need a SAP Note or fill a checkbox of flag or something that indicates that I need those characteristics.
Thanks.
Patricia -
Hi
I'm using RFBIBL00 prg for doing FB01 postings.
I use structures BBKPF,BBSEG. Actually in the source file i have 50 line items.
All the 50 line items should get posted as one Document. Now what happens is for each source record..a separate document is created.
Pls help... how to achieve thisI have done a similar thing using RFBIBL00.
I upload transactions via an excel spreadsheet and submit these to RFBIBL00.
Have a look at the code below:
======================================================================
Report : Purchase Card Interface *
======================================================================
Title : General Ledger Posting Interface *
Author : Andy Scott *
Date : 15/12/2006 *
Purpose : To process an input file containing G/L information *
from the Purchase Cards and to create a batch session. *
This batch session will then replicate the G/L Account *
Posting Transaction F-02 (FB01). *
An Excel spreadsheet from RBS is loaded and validated *
against. It is then reformatted and transferred into *
the sap/usr/interfaces directory on to the application *
server. A batch session is then created via RFBIBL00 *
and processed as normal via SM35. *
There are various types of card transactions that can *
be loaded. These are described below: *
Level 1 transaction without split *
- (one transaction line and one VAT line) *
Level 1 transaction with split *
- (multiple transaction lines and VAT lines) *
Level 2 transaction without split *
- (one transaction line and one VAT line) *
Level 2 transaction with split *
- (multiple transaction lines and VAT lines) *
Level 3 transaction without split *
- (multiple transaction lines and VAT lines) *
Level 3 transaction with split *
- (multiple transaction lines and VAT lines) *
======================================================================
Amendment History: *
Date User ID Request Number Brief Description *
15/12/06 CSSCOTTA DV1K914412 Initial development *
======================================================================
*EJECT
REPORT zfii001 MESSAGE-ID z_msszfii.
TABLES
TABLES: csks, " Cost Centre
skb1, " G/L Account Master
aufk. " Order Master (Internal Order)
Internal Table to hold original xls values i.e. Row, Column etc.
DATA: excel_itab LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
*EJECT
Internal table containing data loaded from the Excel spread sheet
TYPES: BEGIN OF purchase_card_record,
bbkpf_ind(1) TYPE c, " Indicates BBKPF (header) record needed
exp_financial(1) TYPE c, " FIN. Exported Financial
trans_date(10) TYPE c, " FIN. Transaction Date
mast_txn_id(10) TYPE c, " FIN. Mastercard Txn ID
merchant_name(30) TYPE c, " MCH. Merchant Name
db_cr_code(1) TYPE c, " FIN. Debit Credit Code
cust_code(20) TYPE c, " FIN. Customer Code
trans_amount(15) TYPE c, " FIN. Primary Trans Amount
vat_amount(10) TYPE c, " FIN. VAT Amount
tax_amount(10) TYPE c, " PUR. Tax Amount
net_trans_amount(15) TYPE c, " FIN. Net Transaction Amount
ext_item_amount(15) TYPE c, " PUR. Extended Item Amount
cost_centre(10) TYPE c, " FIN. Cost Centre
gl_code(10) TYPE c, " FIN. GL Code
internal_order(12) TYPE c, " FIN. Internal Order
account_name(30) TYPE c, " Account Name
line_item_info(30) TYPE c, " PUR. Line Item Information
expense_descr(30) TYPE c, " FIN. Expense Description
vat_indicator(10) TYPE c, " FIN. VAT Eligibilty Ind.
split_sequence(10) TYPE c, " FIN. Split Sequence
country(10) TYPE c, " MCH. Country
acc_address(30) TYPE c, " ACC. Address
company_code(4) TYPE c, " Company Code
split_ind(1) TYPE c, " Indicates Multiple Split Line Items
vat_type(20) TYPE c, " Type of VAT i.e. Normal or Level 3
posting_key(2) TYPE c, " Posting key i.e. 40, 50
holding_gl_account(1) TYPE c, " Post To Holding Account
error_message(50) TYPE c, " Error Message For Holding Account
row(4) TYPE c, " Excel Spreadsheet Row No
END OF purchase_card_record.
DATA:
purchase_card_wa TYPE purchase_card_record,
purchase_card_tab TYPE TABLE OF purchase_card_record,
last_purchase_card_wa TYPE purchase_card_record.
Internal table containing possible errors within the Excel
spread sheet
TYPES: BEGIN OF error_type,
row_num(6) TYPE c,
message(80) TYPE c,
line(200) TYPE c,
END OF error_type.
DATA: error_wa TYPE error_type,
error_tab TYPE STANDARD TABLE OF error_type.
*EJECT
Document Record structures containing RFBIBL00 data
There will be one header BBKPF record with more than one
associated BBSEG record(s) for each transaction.
i.e. BGR00 ( File Session Header )
|
BBKPF
|
BBSEG ....
BBSEG ....
etc ....
BBKPF
|
BBSEG ....
BBSEG ....
etc ....
DATA:
bgr00_record LIKE bgr00, " Batch Input Structure for Session Data
bbkpf_record LIKE bbkpf, " Document Header (Batch Input Structure)
bbseg_record LIKE bbseg. " Document Segment (Batch Input Structure)
DATA: bbseg_tab TYPE STANDARD TABLE OF bbseg.
DATA: empty_bbseg_record LIKE bbseg,
empty_bgr00_record LIKE bgr00,
empty_bbkpf_record LIKE bbkpf.
*EJECT
WORK AREA *
DATA: wa_num_rows_loaded TYPE i,
wa_mod TYPE n,
wa_num_of_invalid_rows TYPE i,
wa_num_of_transactions TYPE i,
wa_num_of_transaction_lines TYPE i,
wa_num_of_vat_lines TYPE i,
wa_error_count TYPE i,
wa_error_exists(1) TYPE c,
wa_company_code LIKE skb1-bukrs,
wa_gl_code(10) TYPE n,
wa_aufnr(12) TYPE n,
wa_counter TYPE i,
wa_output_file(75) TYPE c, " Output file name
wa_period TYPE i, " Payroll Period
wa_first_time(1) TYPE c,
wa_error(200) TYPE c,
wa_unix_command(100) TYPE c,
wa_todays_date(8) TYPE c,
wa_wrbtr(16) TYPE c,
wa_format(3) TYPE c.
Batch Totals *
DATA:
wa_total_amount LIKE bbseg-wrbtr,
wa_total_vat LIKE bbseg-wrbtr.
Internal table to hold UNIX command
DATA: BEGIN OF unix_itab OCCURS 10,
text(80),
END OF unix_itab.
Define constants
CONSTANTS:
c_filename(75) VALUE 'Purchase_Cards',
c_data_directory(75) VALUE '/sapinterfaces/data/',
c_archive_directory(75) VALUE '/sapinterfaces/archive/',
c_holding_gl_account(4) VALUE '7888'.
Excel Spreadsheet Filename / Location
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECTION-SCREEN COMMENT /30(70) TEXT-002.
SELECTION-SCREEN COMMENT /40(40) TEXT-003.
PARAMETERS: pa_file LIKE rlgrap-filename OBLIGATORY MEMORY ID m01.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_file.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
mask = ',.XLS,.XLS'
static = 'X'
CHANGING
file_name = pa_file.
*EJECT
START-OF-SELECTION.
Upload the excel spreadsheet into the the internal table
PERFORM upload_xls_spreadsheet.
Any Records To Process ??
IF wa_num_rows_loaded > 0.
PERFORM process_file.
ELSE.
CONCATENATE 'No Data Found In The Excel Spreadsheet ' pa_file
INTO wa_error SEPARATED BY space.
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
EXPORTING
titel = 'File Error'
textline1 = wa_error
textline2 = 'Does File exist ? '
start_column = 25
start_row = 6.
ENDIF.
END-OF-SELECTION.
*EJECT
Form UPLOAD_FILE
Subroutine to upload excel file
FORM upload_xls_spreadsheet .
Call function to upload spreadsheet into an internal table
REFRESH : excel_itab,
purchase_card_tab.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = pa_file
i_begin_col = '1'
i_begin_row = '2' "Do not require headings
i_end_col = '21'
i_end_row = '10000'
TABLES
intern = excel_itab
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
CONCATENATE 'Problem Trying To Read File' pa_file
INTO wa_error SEPARATED BY space.
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
EXPORTING
titel = 'File Error'
textline1 = wa_error
textline2 = 'Does File exist ? '
start_column = 25
start_row = 6.
ELSE.
PERFORM convert_table.
ENDIF.
ENDFORM. " upload_xls_spreadsheet
*EJECT
Form PROCESS_FILE
This form will control the flow of the program
FORM process_file.
Validate the input file
PERFORM validate_input_file.
Insert Document Header Records
PERFORM insert_bbkpf_indicators.
Display any invalid rows from the imported file
IF wa_error_count > 0.
PERFORM display_invalid_records.
ENDIF.
Create the text batch file which will be submitted to RFBIBL00
PERFORM create_batch_file.
Submit File - Call RFBIBL00 ( Batch Input Program )
PERFORM submit_rfbibl00.
Move the text batch file into the SAP archive directory
PERFORM archive_file.
Display Batch Total Amounts
PERFORM batch_totals.
ENDFORM. " process_file.
*EJECT
Form Validate_Input_File
FORM validate_input_file.
This subroutine will validate the input file against the Business
Rules that have been created by the E-Trading and Accounts teams.
CLEAR wa_counter.
Only select transactions which have not previously been posted i.e. = 0
LOOP AT purchase_card_tab INTO purchase_card_wa WHERE exp_financial = '0'.
wa_counter = wa_counter + 1.
Need to determine the Company Code
CASE: purchase_card_wa-acc_address.
WHEN 'SALFORD CITY COUNCIL'.
wa_company_code = '1000'.
WHEN 'SALFORD COMM LEISURE'.
wa_company_code = '8000'.
WHEN 'NEW PROSPECT HOUSING LTD'.
wa_company_code = 'NPHL'.
ENDCASE.
*EJECT
Cost Centre
IF purchase_card_wa-cost_centre IS NOT INITIAL.
Valid Cost Centre ?
CLEAR csks.
SELECT SINGLE *
FROM csks
WHERE kokrs = wa_company_code
AND kostl = purchase_card_wa-cost_centre
AND datbi = '99991231'.
IF sy-subrc <> 0.
PERFORM create_error_message USING 'Invalid Cost Centre'
purchase_card_wa-cost_centre
purchase_card_wa-row
'Y'.
ELSE.
IF csks-pkzkp = 'X'.
PERFORM create_error_message USING 'CC Blocked For Posting'
purchase_card_wa-cost_centre
purchase_card_wa-row
'Y'.
ENDIF.
ENDIF.
Verify Correct Cost Centre for Company
CASE: wa_company_code.
WHEN '1000'. " Salford City Council
IF purchase_card_wa-cost_centre(1) CA 'JT'.
PERFORM create_error_message USING 'Must Be SCC Cost Centre'
purchase_card_wa-cost_centre
purchase_card_wa-row
'Y'.
ENDIF.
WHEN '8000'. " Salford Community Leisure
IF purchase_card_wa-cost_centre(1) <> 'T'.
PERFORM create_error_message USING 'Must Be SCL Cost Centre'
purchase_card_wa-cost_centre
purchase_card_wa-row
'Y'.
ENDIF.
WHEN 'NPHL'.
IF purchase_card_wa-cost_centre(1) <> 'J'. " New Prospect Housing
PERFORM create_error_message USING 'Must Be NPHL Cost Centre'
purchase_card_wa-cost_centre
purchase_card_wa-row
'Y'.
ENDIF.
ENDCASE.
ENDIF.
*EJECT
GL Account Code
Insert leading zeroes
wa_gl_code = purchase_card_wa-gl_code.
IF purchase_card_wa-gl_code IS INITIAL.
PERFORM create_error_message USING 'G/L Account Code Required'
purchase_card_wa-cost_centre
purchase_card_wa-row'Y'.
ELSE.
Valid GL Account ?
CLEAR skb1.
SELECT SINGLE *
FROM skb1
WHERE bukrs = wa_company_code
AND saknr = wa_gl_code.
IF sy-subrc <> 0.
PERFORM create_error_message USING 'Invalid G/L Account Code'
purchase_card_wa-gl_code
purchase_card_wa-row
'Y'.
ELSE.
IF skb1-xspeb = 'X'.
PERFORM create_error_message USING 'G/L Blocked For Posting'
purchase_card_wa-gl_code
purchase_card_wa-row
'Y'.
ENDIF.
ENDIF.
ENDIF.
*EJECT
Internal Order No.
There can be two types of internal order numbers:
1) RIO - Real Internal Order in format A12345
2) SIO - Statistical Intrenal Order in format 12345
IF purchase_card_wa-internal_order IS NOT INITIAL.
Insert leading zeroes
wa_aufnr = purchase_card_wa-internal_order.
Decide which format. Check first character
IF purchase_card_wa-internal_order(1) CA 'ABCDEFGHIJKLMNOPQRSTUZWXYZ'.
wa_format = 'RIO'.
ELSE.
wa_format = 'SIO'.
ENDIF.
Valid Internal Order - RIO only?
IF wa_format = 'RIO'.
SELECT SINGLE *
FROM aufk
WHERE aufnr = wa_aufnr.
IF sy-subrc <> 0.
PERFORM create_error_message USING 'Invalid Internal Order'
purchase_card_wa-internal_order
purchase_card_wa-row
'Y'.
ENDIF.
IF purchase_card_wa-cost_centre IS NOT INITIAL
OR purchase_card_wa-gl_code(1) <> '7'.
PERFORM create_error_message USING 'Incorrect GL/Int Ord Combo'
purchase_card_wa-internal_order
purchase_card_wa-row
'Y'.
ENDIF.
ELSE.
IF purchase_card_wa-cost_centre IS INITIAL.
PERFORM create_error_message USING 'Cost Centre Required'
purchase_card_wa-row
'Y'.
ENDIF.
IF purchase_card_wa-gl_code(1) NA '45'.
PERFORM create_error_message USING 'Incorrect GL Code for CC'
purchase_card_wa-internal_order
purchase_card_wa-row
'Y'.
ENDIF.
ENDIF.
ELSE.
IF purchase_card_wa-cost_centre IS INITIAL
OR purchase_card_wa-gl_code(1) NA '45'.
PERFORM create_error_message USING 'Incorrect GL Code for CC'
purchase_card_wa-gl_code
purchase_card_wa-row
'Y'.
ENDIF.
ENDIF.
*EJECT
VAT Amount.
IF purchase_card_wa-vat_amount > 0
AND purchase_card_wa-country <> 'GBR'.
PERFORM create_error_message USING 'VAT Must Be 0 For Non UK Trans'
purchase_card_wa-gl_code
purchase_card_wa-row
'Y'.
ENDIF.
Keep a count of how many rows in the spreadsheet are invalid
IF wa_error_exists = 'Y'.
wa_num_of_invalid_rows = wa_num_of_invalid_rows + 1.
ENDIF.
CLEAR: wa_error_exists,
purchase_card_wa.
ENDLOOP.
ENDFORM. " Validate_Input_File
*EJECT
Form Insert_BBKPF_indicators
FORM insert_bbkpf_indicators.
DATA: wa_temp_date(12) TYPE c.
This routine wil make sure that the BBKPF indicator in the table is
set to 'Y' when a new unique FIN. Mastercard Txn ID is reached. This
is so that the correct document header records (BBKPF) can be created
in the text file.
DATA: previous_mast_txn_id(10) TYPE c,
previous_split_sequence(10) TYPE c.
First we need to delete transactions that may have been previoulsy
posted
N.B. This is done after the validation process in order to keep
the row number in sync with the excel spreadsheet
DELETE purchase_card_tab WHERE exp_financial = '1'.
Sort Data Into FIN. Mastercard Transaction No. and Split Sequence order
SORT purchase_card_tab BY mast_txn_id split_sequence.
Only select transactions which have not previously been posted
LOOP AT purchase_card_tab INTO purchase_card_wa WHERE exp_financial = '0'.
Keep a note of where we will need to write a new Document Header
record i.e. BBKPF. A new Document Header is needed for each unique
Mastercard Transaction ID
IF purchase_card_wa-mast_txn_id <> previous_mast_txn_id.
purchase_card_wa-bbkpf_ind = 'Y'.
previous_mast_txn_id = purchase_card_wa-mast_txn_id.
ENDIF.
We also need to keep a note of the split sequence for multiple line
items. Basically we will not post the lines where the split sequence
held in the Split Sequence (e.g. Split 1 ) is duplicated.
IF purchase_card_wa-split_sequence = previous_split_sequence
AND purchase_card_wa-mast_txn_id = previous_mast_txn_id
AND purchase_card_wa-split_sequence <> '0'.
purchase_card_wa-split_ind = 'Y'.
ENDIF.
previous_split_sequence = purchase_card_wa-split_sequence.
Need to determine the Company Code
CASE: purchase_card_wa-acc_address.
WHEN 'SALFORD CITY COUNCIL'.
wa_company_code = '1000'.
WHEN 'SALFORD COMM LEISURE LTD'.
wa_company_code = '8000'.
WHEN 'NEW PROSPECT HOUSING LTD'.
wa_company_code = 'NPHL'.
ENDCASE.
purchase_card_wa-company_code = wa_company_code.
Convert Transaction Date From DD/MM/YY to DD.MM.YYYY
OR DD/MM/YYYY to DD.MM.YYYY
IF STRLEN( purchase_card_wa-trans_date ) = 8.
CONCATENATE purchase_card_wa-trans_date+0(2)
purchase_card_wa-trans_date+3(2)
sy-datum+0(2)
purchase_card_wa-trans_date+6(2)
INTO wa_temp_date.
ELSE.
CONCATENATE purchase_card_wa-trans_date+0(2)
purchase_card_wa-trans_date+3(2)
purchase_card_wa-trans_date+6(4)
INTO wa_temp_date.
ENDIF.
purchase_card_wa-trans_date = wa_temp_date.
Each transaction line will normally be subject to VAT unless the
transaction line is for a Level 3 with No Splits. If this is the case
only ONE VAT line per transaction will be needed. Where as the other
transactions will have a VAT line posted for each individual line item.
IF purchase_card_wa-country = 'GBR'
AND ( purchase_card_wa-vat_amount > '0.00'
OR purchase_card_wa-tax_amount > '0.00' ).
purchase_card_wa-vat_type = 'Normal'.
ENDIF.
IF ( purchase_card_wa-vat_indicator = 'GBR001'
AND purchase_card_wa-split_sequence = '0' ).
purchase_card_wa-vat_type = 'Level 3 No Splits'.
ENDIF.
Posting Key - 40 ( Debit = '-' ) 50 ( Credit = '+' )
IF purchase_card_wa-db_cr_code = '-'.
purchase_card_wa-posting_key = '40'.
ELSE.
purchase_card_wa-posting_key = '50'.
ENDIF.
Update Internal Table
MODIFY purchase_card_tab FROM purchase_card_wa.
ENDLOOP.
Now need to remove all the duplicated split sequences
i.e. Where split_ind = 'Y'.
DELETE purchase_card_tab WHERE split_ind = 'Y'.
ENDFORM. " insert_bbkpf_indicators
*EJECT
Form display_invalid_records
FORM display_invalid_records.
WRITE: ' Total No Of Rows Uploaded From Spreadsheet:',
wa_num_rows_loaded,' From File : ' ,pa_file.
WRITE sy-uline.
SKIP 1.
FORMAT INTENSIFIED.
SKIP 1.
WRITE: /40 'I N V A L I D D A T A '.
SKIP 1.
WRITE: /3 'Row',
15 'Error Message',
100 'Original Data'.
WRITE: /2 '------',
15 '----
100 '----
FORMAT INTENSIFIED OFF.
Display contents of all invalid records from the excel spreadsheet
LOOP AT error_tab INTO error_wa.
COMPUTE wa_mod = sy-tabix MOD 2.
Use alternative colours
IF wa_mod = 0.
FORMAT COLOR COL_KEY.
ELSE.
FORMAT COLOR COL_HEADING.
ENDIF.
WRITE: /3 error_wa-row_num,
15 error_wa-message,
100 error_wa-line.
ENDLOOP.
SKIP 1.
FORMAT COLOR COL_NEGATIVE.
WRITE: ' No. Of Invalid Rows ', wa_num_of_invalid_rows,
' Total No. Errors In Spreadsheet ' ,wa_error_count.
ULINE.
ENDFORM. "display_invalid_records
*EJECT
Form create_batch_file
This form will create the text file containing all of the transaction
lines data i.e. BBKPF,BBSEG etc. This text file is then passed to the
SAP standard program RFBIBL00 which will create a batch session.
FORM create_batch_file .
Calculate payroll period
IF sy-datum+4(2) >= 4.
wa_period = sy-datum+4(2) - 3.
ELSE.
wa_period = sy-datum+4(2) + 9.
ENDIF.
Todays Date
CONCATENATE sy-datum+6(2)
sy-datum+4(2)
sy-datum+0(4)
INTO wa_todays_date.
Append Date to File Name i.e. filenameDDMMYYYY
CONCATENATE c_data_directory
c_filename
wa_todays_date
INTO wa_output_file.
Initialise Accounting Document Work Areas
PERFORM initialise_structure USING 'BGR00'
'EMPTY_BGR00_RECORD'.
PERFORM initialise_structure USING 'BBKPF'
'EMPTY_BBKPF_RECORD'.
PERFORM initialise_structure USING 'BBSEG'
'EMPTY_BBSEG_RECORD'.
Open t -
LSMW - cannot be run in background since recent SAP Notes
Hi
Sorry if this needs to be moved as not really S&A.
We are on a 4.6C R3 system and are in the process of importing Basis Support Package 61 SAPKB46C61 and I now seem to have lost the ability to run an LSMW in background - the thing runs but does nothing and the logs shows errors on a one to one.
I can run in foreground and also 'Display errors only' but that means my laptop becomes a dedicated LSMW machine for the duration of the process (the screen refreshes and locks you into watching a static screen...
There's plenty about LSMW in SAP Notes but I haven't found anything relevant (611 notes on 'LSMW' and 31 notes on LSMW Background. I remember this happening at a prvious client after they applied some SAP notes but they were on a much later release
Cheers
David
(Next to Derived and composite roles and custom tables and PID's, LSMW isn't one of my favorites...)
Been looking on Google and found a thread shown below on SDN which may help but I can't check until the LSMW running on my works laptop either completes or fails (86,917 entries)
Run the Lsmw in Background or Jobschedule
Posted: Nov 22, 2005 2:06 PM
Edited by: David Berry on Mar 11, 2011 7:07 PMHi Martin
Looks like it's either me or the table I'm trying to update which is the cause as I can still create a user or a user group in background fine...
I'm not aware of any changes to SUKRI in SM30 - bit out of my depth when it comes to this area unfortunately.
THis is the recording for two tcodes in SUKRI
Cheers
David
SAPMSVMA 0100
BDC_CURSOR VIEWNAME
BDC_OKCODE =UPD
VIEWNAME SUKRI SUKRI SUKRI
VIMDYNFLDS-LTD_DTA_NO X X X
SAPLUSKR 0100
BDC_CURSOR SUKRIT-TEXT(01)
BDC_OKCODE =NEWL
SAPLUSKR 0100
BDC_CURSOR SUKRI-TCD2(01)
BDC_OKCODE =SAVE
SUKRI-TCD1(01) TCODE1 TCODE1
SUKRI-TCD2(01) TCODE2 TCODE2
SAPLSTRD 0300
BDC_CURSOR KO008-TRKORR
BDC_OKCODE =LOCK
KO008-TRKORR DEVK9A060G
SAPLUSKR 0100
BDC_CURSOR SUKRI-TCD1(02)
BDC_OKCODE =BACK
SAPLUSKR 0100
BDC_CURSOR SUKRI-TCD1(02)
BDC_OKCODE =BACK -
Standard LSMW for open vendor items with Withholding tax
Hi All,
I am searching the direct input LSMW which is having the Withholdig tax. There is a direct input program in LSMW ( RFBIBL00) but it is not uploaded the withholding tax for open vendor and open customer items.
If anybody know which LSMW is recammanded or anthing related to BAPI or IDOC for this requirements.
Dhiraj.Hi
If you need to upload the WT tax you have to fill the structure BWITH of std BI RFBIBL00, so your LSMW project should create a file like this:
---> Session data
BGR00
---> Document data
BBKPF (Header data
BBSEG (Vendor or customer item)
BWITH (Withholding tax data)
BBSEG (G/L item)
Max -
How to use std object RFBIBL00
Dear All,
For uploading open item of vendor and customer std lsmw RFBIBL00 is available.
I know how to do recording in lsmw for new object but any one can help how to use std lsmw available in SAP. For eg.RFBIBL00
Regards,
BhadreshYou'll find that the RFBIBL00 program, suprisingly, has extensive documentation attached - or you could try
http://help.sap.com/saphelp_45b/helpdata/en/35/a47e63763e0392e10000009b38f9b7/content.htm
or the print documentation at
help.sap.com/printdocu/core/Print46c/en/data/pdf/CAGTFADM/CAGTFADM-FI.pdf
cheers
Jonathan
Maybe you are looking for
-
Variable size item Vs Stock item
Hi Experts, I have a doubt regarding the use of variable size item over standard stock item. I will give an example as under. I have an item called cable which is to be added to a header material. This cable will be used in many header materials. I t
-
Photoshop CS4 crashing on Vista 64-bit
I downloaded PSCS4GPU_OptionalPlugins.zip from http://kb.adobe.com/selfservice/viewContent.do?externalId=kb405064 It includes Disallow OpenGL Windows and Allow Old GPUS script files that are are also uninstallable. On my machine at work (Windows XP P
-
How to get chart option in Test tab with TFS 2013 update 4?
Hello, I have installed Visual studio ultimate - TFS 2013 update4, but I do not see "chart" option in Test plan. What are the steps to enable this feature in TFS web client?
-
Hi, Suppose I wanted to call external services.Scenario is, client send SOAP the request to HTTP Bc, HTTP B to NMR . Now is NMR directly connects to the external service Or NMR sends the request back to HTTP Bc and HTTP Bc connects to the external se
-
Firefox isn't restoring last session, holding on to old closed windows...
I have my Firefox browser set to restore my previous session. However, when the browser crashes or my computer is turned off and then back on, it will only restore a single blank browser window. I know a fix around this, though - go to History and Re