Tcode FB01
I m populating FB01 tcode...using BAPI BAPI_ACC_DOCUMENT_POST..in my flat file for populating Fb01..i have two fields vendor and account...but where r these fields in BAPI structure...but while entering values in FB01 i m entering both vendor and account values in same field rf05a-newko(account)...where is this field in BAPI structure..
see...if i have fields below...how to populate in BAPI...
Company Document number Document Type Posting date Document Date Currency Amount Vendor no. Matriculation Number Cost Center Account Order Posting Key Due Date Text field Special G/L Assignment
DM10 E000000001 ES 27072009 27072009 EUR 200 1000006 34 27072009 LAST DATE OF EXP.NOTE:27.07.2009 E000000001
DM10 E000000001 ES 27072009 27072009 EUR 200 1910011 40 EXP.NOTE NO:E000000001 EMPLOYEE NAME: MARIO Romani E000000001
DM10 E000000001 ES 27072009 27072009 EUR 200 1000006 25 27072009 LAST DATE OF EXP.NOTE:27.07.2009 E000000001
DM10 E000000001 ES 27072009 27072009 EUR 200 2103001 50 EXP.NOTE NO:E000000001 EMPLOYEE NAME: MARIO Romani E000000001
where exactly i need to send to which structure...pls help....
Similar Messages
-
Adding new field from BKPF to tcode FB01 appearing as on selection screen
Hi all,
Could u please let us know to add a field from table BKPF in tcode FB01 ?
1. We did BADI for 'FI_HEADER_SUB_1300 ' and added the required field in the layout.
2. After actiavting, the added field is not getting reflected in the tcode FB01.
Please tel us , where are we going wrong.Looks like a similar requirement in this: How to Add XREF1_HD(Reference Key 1 internal for document Header) field to header level to transaction FB01
-
BDC for AR Posting (Tcode - FB01)
Dear All,
I am unable to post multiple line items while postnig AR Invoice using BDC recording of FB01.
Can anyone provide me the BDC program code to post multiple line items.
Thanks in Advance,
Harishhi,
please check your document type with tcode oba7
field cust./vend. check (t003-XKKPR) -> set value = X
pls reward useful answers
thx.
Andreas -
Malicious Usage of Tcode FB01 - Log Question
Hi All
I have found a User who ran FB01 tcode in production system to post for a Company code which the user is not authorized,
I used the ST03N tcode to find the User has run the tcode on that day.
But the problem is the Usage log shows the user running the tcode under Update mode & not there is no log of the user running the tcode under Dialog mode.
I need to Determine if the user has run any batch jobs unknowingly & post for the wrong company code or is it delebarate action.
How can i prove this.
Plz clarify the course of action i need to take to prove whether this was intentional or unintensional action.
regards
NaveenHi,
ST03n in expert mode should give you the details. Probably the task type is the field which will let you know the mode in which the work process was executed. The different modes are:
D Dialog,U Update,S Spool,I Batch input,B Batch,E Enqueue.
For more details: please refer http://help.sap.com/saphelp_nw70/helpdata/EN/d7/7de93a2176a418e10000000a11402f/frameset.htm -
Regarding Accounts Payble and Accounts receivable in Tcode FB01
Hi All,
Can anybody tell me the diffrence between <b>Accounts payble and Accounts payble adjustable</b> in post document - FB01.
Also tell me the diffrence between <b>Accounts receivable and Accounts receivable adjustable</b> in post document - FB01.
Thanks in advance.
Thanks & Regards,
Rayeez.Hi Stuart,
If you define the code from the G/L account determination screen then it automatically
picks the code when add the new BP manually or through DTW.
If you are not define code from the G/L account determination screen then you cannot add the
BP manually or Through DTW it shown the error message.
If you define the code from the G/L account determination screen then you want to
change the code in accounting tab at the time of BP added manually or through DTW
you can change the code it will allow.
*Close the thread if issue solved.
Regards
Jambulingam.P -
here i have question
provided the transaction A was contianed in the first batch file and posted into the system successfully ,
and also contained in the second batch file by mistake, how the tcode fb01 treated it as the duplicate posting ?
any response will be appreciated
many thanksExactly what is my requirement is standard function module checking based on some parameters. In this requirement different way to check this process.
-
Hi Guys,
I want to write a validation to restrict a specific user from accessing the tcode FB01 and FB02.
how can i write the validation in GGB0.
Say the user is XYZ , I want to block XYZ from accessing FB01 and FB02 in the validation.
Pls suggest.
Thanks,
Srikanth.Hi Srikanth,
Whatever you created Validation in GGB0 that is available in OB28 automatically.
So that you could get that error message
So take the position for your company code and double click that line item.you can able to see the what you did the configured the settings in validation rule ,come back from there and you have to give the action level 1 and save it
After that test it
Now it will work
May be this information is useful to you
If you have nay doubt feel free to ask
Regards
Surya -
Hi,
i would like use standard FM IDOC_INPUT_INVOIC_FI (and IDOC_INPUT_INVOIC_MM) for processing IDOC invoic02 but i need to manage when i post idoc (using tcode FB01) and when park (FBV1). Default FM IDOC_INPUT_INVOIC_FI read these parameters from T076S but i need change parameter in user-exit(?) dynamicaly.
form programmparameter_lesen tables para_tab
if t076s-ediprp = 'X'.
if verarbeitung = 'FI'.
para_tab-tcode = 'FBV1'.
elseif verarbeitung = 'MM'.
para_tab-tcode = 'EDI4'.
endif.
else.
if verarbeitung = 'FI'.
para_tab-tcode = 'FB01'.
elseif verarbeitung = 'MM'.
para_tab-tcode = 'EDI1'.
endif.
endif.
ThanksHi,
I have the same problem. Did you find an answer to this?
thanks -
Hi,
I need Badi's for this tcode FB01,F-43,FB60( When i am posting Invoice with this Transaction). I need to be blocked for payment upon posting in order.
Thanks
Moderator message: please do more research before asking.
Edited by: Thomas Zloch on Apr 6, 2011 12:43 PMHi,
You can implement the BTE as said above:
00001020 POST DOCUMENT: Prior to final checks -- This triggers on Save Button
00001010 POST DOCUMENT: Check customer line item -- This triggers on Customer Line item when you press enter key
00001011 POST DOCUMENT: Checks at line item level --- This Triggers for all line items when enter key is pressed.
Go to transaction FIBF to find the BTE and you will have the documentation for each BTE there.
Hope this helps
Regards
Shiva -
Hi friends,
The requirement is something like this.
When we post a document using tcode FB01, in few cases we get a warning message
"Tax entered incorrect (code P1, amount 0.00)". We get this Warning message, when we click on Save button.
Now, the requirement is to capture this warning and replace this with an Error Message. If that is not possible, then when we get this warning, posting of document should not be allowed.
I searched for some User Exit/ BADI with which i can acheive this, but could not find any. Could any one of you let me know how to acheive this?
Thank you.
Best Regards,
Ram.Hello,
user exits
F050S001 FIDCMT, FIDCC1, FIDCC2: Edit user-defined IDoc segment
F050S002 FIDCC1: Change IDoc/do not send
F050S003 FIDCC2: Change IDoc/do not send
F050S004 FIDCMT, FIDCC1, FIDCC2: Change outbound IDoc/do not send
F050S005 FIDCMT, FIDCC1, FIDCC2 Inbound IDoc: Change FI document
F050S006 FI Outgoing IDoc: Reset Clearing in FI Document
F050S007 FIDCCH Outbound: Influence on IDoc for Document Change
F180A001 Balance Sheet Adjustment
FARC0002 Additional Checks for Archiving MM Vendor Master Data
RFAVIS01 Customer Exit for Changing Payment Advice Segment Text
RFEPOS00 Line item display: Checking of selection conditions
RFKORIEX Automatic correspondence
SAPLF051 Workflow for FI (pre-capture, release for payment)
BADIs
AC_QUANTITY_GET Transfer of Quantities to Accounting - Customer Exit
BADI_ENJ_ALT_ADR Go to alternative vendor/customer data
BADI_F040_SCREEN_600 Screen Enhancement on F040 0600 Document Header
BADI_FDCB_SUBBAS01 Screen Enhancement 1 on FDCB Basic Data Screen (010, 510)
BADI_FDCB_SUBBAS02 Screen Enhancement 2 on FDCB Basic Data Screen (010, 510)
BADI_FDCB_SUBBAS03 Screen Enhancement 3 on FDCB Basic Data Screen (010, 510)
BADI_FDCB_SUBBAS04 Screen Enhancement 4 on FDCB Basic Data Screen (010, 510)
BADI_FDCB_SUBBAS05 Screen Enhancement 5 on FDCB Basic Data Screen (010, 510)
BADI_PRKNG_NO_UPDATE BAdI for Deactivating Update of Parked Documents
F050S008 FIDCC1, FIDCC2 Inbound IDoc: Update Comparison Ledger
FBAS_CIN_LTAX1F02 Tax interface
FBAS_CIN_MF05AFA0 EWT - Downpayment Clearing - Tax transfer for CIN
FI_AUTHORITY_ITEM Extended Authorization Check for Document Display (FB03)
FI_GET_INV_PYMT_AMT BAdI for determining the payment amount for an invoice
FI_HEADER_SUB_1300 Screen Enhancement for Document Header SAPMF05A
FI_PAYREF_BADI_010 BAdI: Payment Reference Number
FI_TRANS_DATE_DERIVE Derive BKPF-WWERT from Other Document Header Data
INVOIC_FI_INBOUND BADIs for Inbound IDoc INVOIC FI (Vendor Invoice)
RFESR000_BADI_001 BAdI for Own Processing of POR Item
Thank u,
santhosh -
Issue in LSMW(Direct Input) for FB01 with (RFBIBL00)
Hi All,
I am developing a LSMW-Direct input method for TCode-FB01 using program RFBIBL00.
I am using one file as input file. I have below fields in the file.
STYPE
BLART
BUKRS
BLDAT
BUDAT
MONAT
WAERS
KURSF
XBLNR
BKTXT
XMWST
NEWBS
NEWKO
NEWUM
WRBTR
KOSTL
PROJK
AUFNR
PRCTR
SEGMEN
MWSKZ
WMWST
ZFBDT
ZUONR
SGTXT
My Data is as below: (Single record) 1 - Header data, 2-Item data
1 SA 1123 01062009 01062009 6 USD Test1 Testing
2 40 100005 10 Test Test
2 50 100005 10 Test Test
After 'Converted data' step it is displaying 7 rows instead of 3 rows for BGR00, BBKPF, BBSEG.
Is there any condition(logic) i need to write to make it to 3 rows.
All the data displayed above is for single record.
Because of this issue i am not able to create document through FB01.
How to solve this issue!
Thanks,
Deep.you need to pass 2 strctures like below
1 is header and 1 is item
here INDENT is link between 2 files
in your case 1 record: BGR00,
1 record : BBKPF
2 records: BBSEG
its only 4 records, i think you file contains space for 3 more record you check that.
and also in the last step you have option for creating the batch input method, create BI and run in foreground ....
YFIC_HEADER Header
INDENT C(010) Identifier
BLDAT C(008) Document Date
BLART C(002) Document Type
BUKRS C(004) Company Code
BUDAT C(008) Posting Date
MONAT C(002) Posting Period
WAERS C(005) Currency
KURSF C(009) Exchange rate
BELNR C(010) Document Number
WWERT C(008) Translation Date
XBLNR C(016) Reference
BVORG C(016) Cross-co. code no.
BKTXT C(025) Document Header Text
PARGB C(004) Trading part.BA
XMWST C(001) Calculate Tax
LDGRP C(004) Ledger Group
YFIC_ITEM Item Data
INDENT C(010) Identifier
NEWBS C(002) Posting Key
NEWKO C(017) Account
NEWUM C(001) Special G/L ind.
NEWBW C(003) Transact. type
WRBTR C(015) Amount
MWSKZ C(002) Tax Code
XSKRL C(001) W/o cash disc.
KOSTL C(010) Cost Center
AUFNR C(012) Order
GSBER C(004) Business Area
PRCTR C(010) Profit Center
RASSC C(006) Trading Partner
FKBER C(004) Functional Area -
Create BDC group per uploading excel file to fill data in Tcode FB01l
hi experts,
i'm using BDC to run T-code FB01L . for this i'm uploading excel file for input data. my requiremenr=t is as follows : "
only one BDC group should be created per uploading file." But At this moment BDC group is created per document. For user it is not possible to handle, say 1000 BDC groups.
please suggest.
Thanks
DeepikaThe answer is simple and you should be able to work it out yourself but I am feeling generous today.
I am assuming that each line in your excel spreadsheet is a document. The easiest way to do this is simply build up youd BDC table first then create the group.
<- build your bdc table before opening the group ->
call function 'BDC_OPEN_GROUP'
exporting
group = p_group
keep = p_keep
user = p_uname.
call function 'BDC_INSERT'
exporting
tcode = 'FB01'
tables
dynprotab = gt_bdcdata
exceptions
internal_error = 1
not_open = 2
queue_error = 3
tcode_invalid = 4
printing_invalid = 5
posting_invalid = 6
others = 7.
call function 'BDC_CLOSE_GROUP'
In the future please do a search on SDN. I have also moved this thread to the ABAP General forum as this is not related to ABAP OO. -
Friends,
I have a Transaction Z, to read a file and created documents in FI, using Call Transactio 'FB01'.
The document is created with the field BKPF-TCODE = 'FB01', Would record the transaction in the field Z ?
Anyone know of any exit or badi for this ?
Thanks,
FabioHi,
When we use the BAPI BAPI_ACC_DOCUMENT_POST, the field BKPF-tcode is filled with the Z-transaction, however, if we run the same program in background this field is not filled. I such a case what is the solution. Is creating an enhancement in the include LACC9F20 , form FILL_ACCHD the only option?
Thanks -
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.
-
Validations using OB28 is not working for GL posting using FB01
Hi Experts,
Validations using OB28 for posting using FB01 is not working.
My requirement is after entering a line items and click post validations should be triggerd.
i want to block a posting based on document type.
i have maintained as below..
Prerequisite.
( BKPF-TCODE = 'FB50' OR BKPF-TCODE = 'FB01' ) AND (
BKPF-BUKRS = '1000' OR BKPF-BUKRS = '0001' OR
BKPF-BUKRS = '0002' ) AND BKPF-BLART = 'XX'.
check.
Used userexit to check sy-ucomm = 'BU' (for posting).
entries are maintained in OB28 for relevant company codes.
it is working for FB50 but not FB01.
same thing i tried to maintain at header level as well as item level. but it is working only for FB50 but for FB01.
Please help me.
Regards.
Venu.Hi Venu,
Go to GGB0 and expand the navigation till you reach the validation name of line item level and choose menu item *Validation -> Simulate.
Here you can enter the inputs, those you are entering while doing FB01 and execute it.
Then in the results, you will have the log for each step of your total validation of line item level.
Check , whether your questioned STEP's pre requisite is met and check is not fullfilled.
Accordingly you can make the changes to the STEP.
This info may help you.
Regards,
Srinivas
Maybe you are looking for
-
The rankmirrors script should be included in the beginners' guide
I thought it was at one point. But it's a very useful script and I use it everytime I install Arch. You probably should use it regularly just to make sure you're using the fastest mirrors. Why isn't this mentioned in the pacman optimization wiki eith
-
Making an interactive pdf with animations and a video?
Hi Everyone, I'm working in InDesign CS6 and I've made a interactive pdf with swf animations, exported it to an interactive pdf and everything works great from the little animations to the page curl. Now, I would like to put a video in on one of the
-
Another query about installing BT Infinity2 and lo...
History. We occupied a new build house in 1998. It was fitted with a BT Master Socket (Line Box) which is situated in a front corner of the Living Room. We wanted to have the 'phone in a different corner of the room and also wanted to install some
-
Delete System error message in MDT automatically
Hi Experts, I would like to seek your help to solve the following problem. I would like to know is there any ways that we can cancel the messages in MDT which falls under "System Error"automatically. For example: Sender:A and Receiver :B I only like
-
How reduce Sbo-common log is over 40GB??
Hi all I have a big problem that what I think my SBO-COMMON_log.LDF is very big and the server tell me everyday that I don't have enough free space on HD. I'd tried to clean and shrink the SBO-COMMON_log.LDF but I can't. Please HELP!!! Thanks all. Pa