Substitution BSEG-ZBD1T
Hi Experts!,
I need to change te field BSEG-ZBD1T with a FI substitution or a user-exit. I change the value BEXCLUDE of the table GB01 but I can`t change the field in my substitution yet.
Any idea??
Thanks
Hi,
Did you already run program RGUGBR00 to regenerate the substitution? If not, refer to [Note 842318|https://service.sap.com/sap/support/notes/842318] which includes the following instructions: "...make sure that the generated source code is up to date. You can use the report RGUGBR00 to do this. Call this report in transaction SE38... enter the application area, for example FI, and the application callup point... and set all indicators except for 'Generate substitution routine in all clients' and 'Generate trace program calls'. Then execute the report." The callup points can be found in table GB31 (for VALUSER = 'FI').
If you have already generated with RGUGBR00 and still have a problem, then further research (and possibly a customer message to SAP) might be needed.
Cheers,
Jamie
Similar Messages
-
HOW TO ADD FIELDS OF BSEG-ZFBDT & BSEG-ZBD1T
hi frnds.
currently iam working on SD MODULE I NEED the NET DUE DATE SO HOW TO DO THAT
1 problem plz:
HOW TO ADD FIELDS OF BSEG-ZFBDT & BSEG-ZBD1T
TOGETHER
one is date & other is numeric value so how?
one is date & other is numeric value so how to add this 2 fields
& finally i want to display the o/p in date format dd/mm/year
THANKS IN ADVANCE.Hi Mahesh,
one of the nice features of ABAP is that it takes care about month/year changes when adding days/month on a date.
ADD lv_zbd1t TO lv_zfbdt.
This should work fine. If not, try to convert zbd1t into an integer first.
To get you preferred date output format try this:
DATA: lv_datestring TYPE string.
CONCATENATE lv_zfbdt+6(2) '/' lv_zfbdt+4(2) '/' lv_zfbdt(4)
INTO lv_datestring.
This isn't tested, but should give you a clue.
Regards,
ok -
Hi,
I am working on 4.6C system.
We have an issue with substitution created for FI document. We are trying to substitute the field 'Insurance Indicator' (BSEG-VRSKZ) via some logic.
The issue is that the substitution works well when we create a customer invoice via FB70 or FB01 (Direct Posting), however it does not work when we are creating the FI document indirectly- via SD while creating billing document.
We put the breakpoint in both the cases and found that BSEG-VRSKZ is populated correctly when the program leaves the substitution rule. So just want to know if there are any other places where BSEG fields could have been changed in case of indirect posting ? Any other clues ?
Regards,
VinThere are sevral user exits for the billing document creation. Take a look at SDVFX004. It may do the trick.
I have also included all the other exits below;
pls assign points if helpful as a way to say thanks.
SDVFX001
SDVFX002
SDVFX003
SDVFX004
SDVFX005
SDVFX006
SDVFX007
SDVFX008
SDVFX009
SDVFX010
SDVFX011
V05I0001
V05N0001
V60A0001
V60P0001
V61A0001 -
Substitution:: BSEG-HKONT
Hi Norman,
Based on your posting i have checked the Table GB01 and identified that for BSEG and field HKONT the BEXCLUDE='X'. So
I have written a small ABAP program to remove the 'X'.
Code:
Tables: GB01.
GB01-BOOLCLASS = '009'.
GB01-CLASSTYPE = 'S'.
GB01-BCLTAB = 'BSEG'.
GB01-BCLFIELD = 'HKONT'.
GB01-BEXCLUDE = ' '.
Modify GB01.
Later when checked the record in GB01 the BEXCLUDE field was ' '.
I then went into Object ZGGBS000 and under the "GET_EXIT_TITLES" created the entry
EXITS-NAME = 'U9012'.
EXITS-PARAM = C_EXIT_PARAM_CLASS.
EXITS-TITLE = 'Replace GL Account (5th & 6th Char to 01)'.
APPEND EXITS.
In the FORM
FORM U9012 USING BOOL_DATA type gb002_009 changing b_result.
(At this point i receive the error "gb002_009 is unknown").
I looked in the declaration
type-pools: GB002. and i could not see any Type definitons for Boolean classes '009' init.
As this is an Standard SAP Object how does the gb002_009 entry be made into this.
Would be great if you could let me know the steps on this.
Code:
DATA: I_BSEG like BSEG.
CLEAR I_BSEG.
I_BSEG = BOOL_DATA-BSEG.
I_BSEG-HKONT+4(2) = '01'.
Please correct me if i am wrong.
Thank you,
- SravanCould not find the code, but these seems to work...
FORM U999 USING BOOL_DATA TYPE GB002_015.
DATA: LS_BSEG LIKE BSEG.
LOOP AT BOOL_DATA-BSEG INTO LS_BSEG.
LS_BSEG-HKONT+4(2) = '01'.
ENDLOOP.
ENDFORM.
However, I agree with Rob. Changing GL numbers seems very dangerous. Can't this be accomplished with configuration? Why do you need to re-map GL numbers during a financial transaction? -
FI Substitution rule on completed document
Hi Everyone,
We're trying to create a substitution rule to change the payment terms on our invoices (fields BSEG-ZTERM and BSEG-ZBD1T). We're having trouble with our prerequisite: If any of the expense distributions are being charged against a federal grant (BSEG-GRANT_NBR) then call the substitution rule. We want our exit to loop through all distribution lines and if it finds any being charged to a grant it should set the condition to true and substitute...if it doesn't find any it should be set to false.
We've done all of the necessary steps:
-Activated the fields on GB01
-Defined the substitution rules on OBBH
-Build and compiled the user exit.
Problem we're having is that when there are multiple lines it only seems to be reading the last line item to make the determination.
Example 1:
Line 1 Grant
Line 2 No Grant
Result is that payment terms are not substituted. It should be substituted because line 1 hit a grant.
Example 2:
Line 1 No Grant
Line 2 Grant
Result is that payment terms are substituted correctly.
My ABAPer says that the problem seems to be that on the completed document he can only see the last line (not all the lines)....does anyone know a way to loop through all the records on a completed document? It seems that substitution gets called before records get inserted into the database so we're not sure how to make our pre-requisite work.
thanks for your helpHi,
here is the solution.
Create your user exit.
FORM u280 USING bool_data TYPE gb002_015.
FIELD-SYMBOLS: <ls_bseg> LIKE LINE OF bool_data-bseg,
LOOP AT bool_data-bseg ASSIGNING <ls_bseg>.
* Here is your logic needed
ENDLOOP.
Create a substitution for the complete document in GGB1 and choose no field but "Only exit'. -
G/L account substitution with invoice reverse
Hello Gurus,
We have posted an invoice which is replacing G/L account value with the help of substitution ( substitution name = 'FPD_FNL') in MR8M tcode in which we have used the user exit 'U408' with some fixed value say 'X' but when we are doing the reverse invoice in that case its not showing sustituted G/L account value.
Can anyone help are we need to use the different user exit for reversing the invoice apart from 'U408'?
In the code, user exit is triggering for invoice reverse but for that particular document type EBELN is coming blank and hence it wont enter in our code.
BR
SumeetHi,
I doubt if above note can be used.
Please see below description from the note i.e the fields which can be used for the substitutio.
You can carry out a substitution for some fields. If invalid values are
substituted in this case, you may receive the wrong function o
r error messages in standard programs. However, these errors are not
particularly critical. You can currently release the following fi
elds for substitution:
BSEG-FIPOS, BSEG-HBKID, BSEG-MSCHL, BSEG-MANSP, BSEG-MADAT, BSEG-MANST,
BSEG-MABER, BSEG-RSTGR, BSEG-ZLSPR
But we want to substitute HKONT ( G/L account ) for the same.
BR
Sumeet -
Substitution Rule for Payment Term
Hi Expert,
I have to have Substitution for payment term the following criteria:
Company Code = '1000' AND Document Type = 'L1' AND Posting key = '14', then ... substitution bseg-zterm with certain payment term.
Problem: there is no substitution for bseg-zterm.
I read the post at http://sap.ittoolbox.com/groups/technical-functional/sap-acct/substitution-rule-for-payment-term-489202
and found that I need to apply a SAP note 42615 in order to enable the BSEG-ZTERM field in Substitution Rule for Payment Term, and after that run Program RGUGBR00 to regenerate the substitution.
But, problem again, our SAP is ECC 6.0, and the said SAP note is not applicable.
Kindly advise is there any other way that I can enable the bseg-zterm field at substituion.
Thanks,
sbmelHi
1. Go to SE16N and enter Table GB01
2. Enter &SAP_EDIT in the command prompt i..e the space where you type your T code and press enter
3. BCL TAB = BSEG and Field = ZTERM... Execute
4. Remove the X for the field BEXCLUDE.. SAVE....
5. Select this entry and menu Table > Transport > Include in tr request
6. Run RGUGBR00
Br, Ajay M -
BSEG-VBUND Updation using Call up point 3 while posting from VF01
Hi,
I have a requirement to update BSEG-UPDATE during the Invoice posting VF01.
I tried to use Substitution at CALL UP POINT 3. but it is not updating the value.
Please help.
Thanks,
Leela KrishnaHi,
Create the substitution at call up point 2 (Line Item) as below:-
Pre-requisit:-
BSEG-KOART = 'D'
AND
BSEG-TCODE = 'VF01'
Substitution:-
BSEG-VBUND = your trading partner
Regards,
SDNer -
Hi all
Has any1 done Business Place/Section Code substitution for FB60 in ver 4.7? If yes, can some1 help me with the steps?
Thxs in advance
HrishiHello,
For any t.code not only FB60.
Prerequisite :
BSEG - GSBER = 1100 ( this is our business area)
Substitution :
BSEG - BUPLA = B001
BSEG - SECCO = B001
In the above condition whenever the system finds the business area is 1100. Automatically substitute the below two fields.
if u want only for transaction code FB60. Specify the transaction code in the place of business area or u can specify both by adding AND.
Hope this is clear, if yes assign points
Regards,
Sankar -
Payment terms - due date on a particular day of the week say friday?
Experts is it possible in SAP payment terms to configure a term such that due date is on a particular day of the week?
I want use payment term to determine due date for weekly billing cycle (sunday to saturday) for the invoice to be due on Friday net 27 days from mid point of the week
eg 1. if a customer is invoiced any day between October 4th to 10th, the due date should be Friday Nov 6th
eg 2. if a customer is invoiced and day between October 11th to 17th, the due date should be Friday Nov 13th
Is this possible?
Thanks in AdvanceYou need custom development for this. Using custom development, Substitution in FI or User exit in SD
I. FI Substitution -
Create substitution with exit, for field day1 (BSEG-ZBD1T) and baseline date (BSEG-ZFBDT). In exit, determine number of days for required Friday from baseline date you want to use (say document date). This way, due date will be on Friday.
For determining Friday, use calendar or Ztables.
II. Invoices created in SD - If you are gerenating invoices in SD, use exit EXIT_SAPLV60B_008. This exit has table ACCIT which also has same fields Day1 and Baseline date. Follow same logic mentioned above.
I hope this helps. -
Payment Terms (Fixed Due Date)
Hi All,
I have a requirement where in I need to set up a new Payment term 123 as an installement payment term.
The payment term is divided as follows:
Payment Term A: 25% (Due Immediately)
Payment Term B: 25% (Payable on May 30)
Payment Term C: 25% (Payable on June 30 => Baseline date calculation: Fixed day: 30 additional months:1)
Payment Term D: 25% (Payable on October 30 => Baseline date calculation: Fixed day: 30 additional months: 5)
Now the above can we achieved by creating a condition type (VK11) and adding the Main Payment Term 123 in that condition type with a fixed due date.
Then corresponding payment terms B,C and D can be set according to the fixed due date(mentioned in condition type) in OBB8
But how do I capture the payment term A since it will be on the basis of Billing date and not fixed due date mentioned in condition type.
Also, please suggest an alternate approach in setting up the above payment term 123 and if any ABAP effort is also required.
Thanks,
ArunaHI,
You can use the custom development for it:-
(A) For FI Documents:-
Use FI Substitution in OBBH with exit.
For field day1 (BSEG-ZBD1T) and baseline date (BSEG-ZFBDT). Here check the baseline date for October?
Your ABAPer can code this.
(B)For SD Documents:-
Use user exit EXIT_SAPLV60B_008.
This exit has table ACCIT which also has same fields Day1 and Baseline date. Follow same logic mentioned above.
Regards,
Gaurav -
Defaulting Payment Term & Determining due date
Dear All,
We are using the substituions to default the payment term to ZS28 for document type ZO.
In the transaction FB60 after entering the document date and other details, If I click on the payment tab the payment term is being populated correctly as ZS28. But the no of days and due date are being populated incorrectly.
I am trying to update the field BSEG-ZBD1T in user exit of the substitution, but this values is being overwritten before displaying in no of days.
For example I'm having base line date as: 03.08.2011
I am setting the field BSEG-ZBD1T = 25 in user exit, and I have to get the due date as 28.08.2011.
But the field BSEG-ZBD1T is modifed to 1 by the program and due date is displayed as 04.08.2011.
Please help me to get the correct due date and no of days.
Regards
RakeshHi All,
After updating the value in user exit, the value of the field BSEG-ZBD1T is being modified by the form 'EXP_TAB_009_BSEG' in program 'GBTAKFI0' .
Because of this I'm unabel to claculate the actual due date. Pls help on this.
Regards
Rakesh -
521
- Heading for trans. w/out sp.G/L indicators (item sorting method 2)-
Transactions without special G/L indicators
522
- Heading for trans. with sp.G/L indicators (item sorting method 2)-
&T074T-LTEXT&
523
- Heading for open item list of line items -
&ULINE(71)&
<K>Invoice No,,Reference.,,Inv.Date,, Due date,,,,
Balance</>
&ULINE(71)&
PERFORM GET_DATE IN PROGRAM ZREPORT
USING &BSID-BELNR&
CHANGING &S_DATE&
ENDPERFORM.
530
- Line items Customer open items -
&BSID-BELNR&,,&RF140-BELEGNUM&,,&BSID-BLDAT&,,&S_DATE&,,
FORM get_date tables
int_cond structure itcsy
outt_cond structure itcsy.
BREAK SNAGI.
tables : bseg.
data : w_belnr type ITCSY-value.
DATA due_date TYPE rfpos-faedt.
READ TABLE OUTT_COND WITH KEY name = 'S_DATE'.
IF sy-subrc = 0.
outt_cond-value = S_itab11.
MODIFY outt_cond INDEX sy-tabix.
ENDIF.
SELECT SINGLE
shkzg zfbdt zbd1t zbd2t zbd3t rebzg
FROM bseg
INTO CORRESPONDING FIELDS OF bseg
WHERE
*bukrs = bukrs AND
belnr = int_cond-value.
*AND vbeln = belnr.
CALL FUNCTION 'NET_DUE_DATE_GET'
EXPORTING
i_zfbdt = bseg-zfbdt
i_zbd1t = bseg-zbd1t
i_zbd2t = bseg-zbd2t
i_zbd3t = bseg-zbd3t
i_shkzg = bseg-shkzg
i_rebzg = bseg-rebzg
I_KOART = 'D'
IMPORTING
e_faedt = due_date.
outt_cond-value = due_date.
MODIFY outt_cond INDEX sy-tabix.
ENDFORM.
Now the problem is that,it is int_cond-value is always picking up the first invoice number.
and the net due date is always same for all invoices..?
should I loop in the sap script or in the form..?Solved my self.
just placing the perform and endform in 530 -
Adding Data to the database for SAP Transactions
Hi
I'm new to the whole ABAP. I would like to enquire about adding transaction data in SAP through ABAP but it must be immediate.
I know that one can use a BAPI to add data and can rollback if any problems occur.
But if no BAPI exists how does one write code to add a document to the SAP database but with everything SAP transaction requires like the BAPI. What is the process and how???
So let say I wanted to do FB01 which is SAP FI document and must be immediate. There is a BAPI that exists for it but if there was not one how would I do this???
I know one can also use BDC but that creates a batch and then needs to be executed in SM35, I want a way to add data for two or three SAP transactions, if any problems occur with any of the steps rollback everything else commit everything to the database.
Any simple detail examples (code) that satisfy the above will be greatly appreciated and REWARDED.
Thanks in advanceLuis,
i have a code exactly same BDC for FB01.
refer:
REPORT z_etching_fb01
NO STANDARD PAGE HEADING LINE-SIZE 255.
*etching invoice load
INCLUDE bdcrecx1.
TYPE-POOLS: truxs , slis.
*PARAMETERS: dataset(132) LOWER CASE DEFAULT
* 'c:\temp\etchingload.txt'.
PARAMETER: pfile LIKE rlgrap-filename." OBLIGATORY.
SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
PARAMETER: p_kunnr LIKE kna1-kunnr OBLIGATORY, "kna1-kunnr
p_bukrs LIKE bseg-bukrs,
p_mwskz LIKE t007a-mwskz OBLIGATORY,"t007a-mwskz
p_prctr LIKE cepc-prctr OBLIGATORY,"cepc-prctr
* p_newko LIKE ska1-saknr OBLIGATORY DEFAULT 41000000,"
p_budat LIKE bkpf-budat OBLIGATORY ,
p_hkont LIKE bseg-hkont OBLIGATORY DEFAULT 41000000 ,
p_waers TYPE waers OBLIGATORY DEFAULT 'GBP'."tcurr-waers
SELECTION-SCREEN END OF BLOCK a.
SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002.
PARAMETER : report AS CHECKBOX DEFAULT 'X'.
SELECTION-SCREEN END OF BLOCK b.
*** DO NOT CHANGE - the generated data section - DO NOT CHANGE ***
* If it is nessesary to change the data section use the rules:
* 1.) Each definition of a field exists of two lines
* 2.) The first line shows exactly the comment
* '* data element: ' followed with the data element
* which describes the field.
* If you don't have a data element use the
* comment without a data element name
* 3.) The second line shows the fieldname of the
* structure, the fieldname must consist of
* a fieldname and optional the character '_' and
* three numbers and the field length in brackets
* 4.) Each field must be type C.
*** Generated data section with specific formatting - DO NOT CHANGE ***
* ALV *
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat LIKE LINE OF it_fieldcat,
it_top_of_page TYPE slis_t_listheader,
ls_layout TYPE slis_layout_alv,
gt_events TYPE slis_t_event.
DATA: it_raw TYPE truxs_t_text_data.
DATA: BEGIN OF record,
* data element: BLDAT
bldat_001(010), "Invoice Date
* data element: BLART
blart_002(002), " Doc Type DR or DG if credit
* data element: BUKRS
bukrs_003(004), " Company Code
* data element: BUDAT
budat_004(010), "Posting Date
* data element: MONAT
monat_005(002), "period"
* data element: WAERS
waers_006(005), "Currency
* data element: XBLNR1
xblnr_007(016), "Invoice Number
* data element: BKTXT
bktxt_008(025), "PO number
* data element: SAEOBJART
docid_009(010),
* data element: NEWBS
newbs_010(002), "posting Key
* data element: NEWKO
newko_011(017), "Customer number or GL account
* data element: WRBTR
wrbtr_012(016), "Amount
* data element: DZTERM
zterm_013(004),
* data element: DZBD1T
zbd1t_014(003),
* data element: DZFBDT
zfbdt_015(010),
* data element: DZUONR
zuonr_016(018), "Invoice Number
* data element: SGTXT
sgtxt_017(050), " PO number
* data element: NEWBS
newbs_018(002),
* data element: NEWKO
newko_019(017), "GL Account
* data element: WRBTR
wrbtr_020(016), "Amount
* data element: MWSKZ
mwskz_021(002), "Tax
* data element: DZUONR
zuonr_022(018), "Invoice Number
* data element: SGTXT
sgtxt_023(050), "PO Number
* data element: PRCTR
prctr_024(010), "Profit Center
* data element: WRBTR
wrbtr_025(016), " Amount
* data element: MWSKZ
mwskz_026(002), "Tax
* data element: DZUONR
zuonr_027(018), "Invoice Number
* data element: SGTXT
sgtxt_028(050), "PO Number
* data element: FMORE
fmore_029(001),
* data element: PRCTR
prctr_030(010), "Pr Center
* data element: FWSTE
fwste_01_031(016),
END OF record.
DATA: BEGIN OF it_excel OCCURS 0,
* data element: XBLNR1
xblnr_007(016), "Invoice Number
* data element: BLDAT
bldat_001(010), "Invoice Date
* data element: WRBTR
wrbtr_012(016), "Amount
* data element: WRBTR
wrbtr_025(016), " Tax Amount
* data element: WRBTR
wrbtr_020(016), "Gross Amount
* data element: BLART
blart_002(002), " No of units
* data element: MONAT
monat_005(002), "No of units second test"
* data element: BKTXT
bktxt_008(025), "PO number
* data element: SGTXT
sgtxt_017(050), " PO number
* data element: BUKRS
bukrs_003(004), " Company Code
* data element: BUDAT
budat_004(010), "Posting Date
* budat_004 TYPE string, "Posting Date
* data element: WAERS
waers_006(005), "Currency*
* data element: NEWKO
newko_011(017), "Customer number or GL account
* data element : kunnr
kunnr_019(010), " customer
mwskz(002),
prctr(010),
date(002),
month(002),
** data element: BKTXT
* bktxt_008(025), "PO number
** data element: SAEOBJART
* docid_009(010),
** data element: NEWBS
* newbs_010(002), "posting Key
** data element: DZTERM
* zterm_013(004),
** data element: DZBD1T
* zbd1t_014(003),
** data element: DZFBDT
* zfbdt_015(010),
** data element: DZUONR
* zuonr_016(018), "Invoice Number
** data element: NEWBS
* newbs_018(002),
** data element: NEWKO
* newko_019(017), "GL Account
** data element: MWSKZ
* mwskz_021(002), "Tax
** data element: DZUONR
* zuonr_022(018), "Invoice Number
** data element: SGTXT
* sgtxt_023(050), "PO Number
** data element: PRCTR
* prctr_024(010), "Profit Center
** data element: MWSKZ
* mwskz_026(002), "Tax
** data element: DZUONR
* zuonr_027(018), "Invoice Number
** data element: SGTXT
* sgtxt_028(050), "PO Number
** data element: FMORE
* fmore_029(001),
** data element: PRCTR
* prctr_030(010), "Pr Center
** data element: FWSTE
* fwste_01_031(016),
END OF it_excel.
DATA : BEGIN OF it_bkpf OCCURS 0,
belnr LIKE bkpf-belnr,
budat LIKE bkpf-budat,
bldat LIKE bkpf-bldat,
xblnr LIKE bkpf-xblnr,
bktxt LIKE bkpf-bktxt,
total LIKE bseg-dmbtr,
numdocs TYPE p DECIMALS 0,
END OF it_bkpf,
BEGIN OF it_bseg OCCURS 0,
belnr LIKE bseg-belnr,
dmbtr LIKE bseg-dmbtr,
mwsts LIKE bseg-mwsts,
pswsl LIKE bseg-pswsl,
END OF it_bseg,
BEGIN OF it_final OCCURS 0,
belnr LIKE bkpf-belnr,
budat LIKE bkpf-budat,
bldat LIKE bkpf-bldat,
xblnr LIKE bkpf-xblnr,
bktxt LIKE bkpf-bktxt,
dmbtr LIKE bseg-dmbtr,
mwsts LIKE bseg-mwsts,
pswsl LIKE bseg-pswsl,
END OF it_final.
***** End generated data section ***
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pfile.
PERFORM sub_browse_file. "Get file name
START-OF-SELECTION.
PERFORM sub_data_load. " Transfer excel into internal table.
PERFORM sub_calc_excel.
IF report = 'X'.
* PERFORM data_selection.
* PERFORM data_move.
*********************************GET ALV DATA
PERFORM alv_get_data.
*********************************ALV GRID DATA
PERFORM alv_grid.
ENDIF.
*if report = ''.
* PERFORM write.
* PERFORM open_dataset USING dataset.
PERFORM open_group.
* DO.
* READ DATASET dataset INTO record.
LOOP AT it_excel.
* IF sy-subrc <> 0. EXIT. ENDIF.
PERFORM bdc_dynpro USING 'SAPMF05A' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF05A-NEWKO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BKPF-BLDAT'
it_excel-bldat_001.
PERFORM bdc_field USING 'BKPF-BLART'
'DR'." record-blart_002.
PERFORM bdc_field USING 'BKPF-BUKRS'
it_excel-bukrs_003.
PERFORM bdc_field USING 'BKPF-BUDAT'
it_excel-budat_004.
PERFORM bdc_field USING 'BKPF-MONAT'
'3'. "record-monat_005.
PERFORM bdc_field USING 'BKPF-WAERS'
it_excel-waers_006.
PERFORM bdc_field USING 'BKPF-XBLNR'
it_excel-xblnr_007.
PERFORM bdc_field USING 'BKPF-BKTXT'
it_excel-bktxt_008.
PERFORM bdc_field USING 'FS006-DOCID'
'*' ."record-docid_009.
PERFORM bdc_field USING 'RF05A-NEWBS'
'01'." record-newbs_010.
PERFORM bdc_field USING 'RF05A-NEWKO'
it_excel-kunnr_019 .
PERFORM bdc_dynpro USING 'SAPMF05A' '0301'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RF05A-NEWKO'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BSEG-WRBTR'
it_excel-wrbtr_020." it_excel-wrbtr_012.
PERFORM bdc_field USING 'BSEG-ZTERM'
'NT30' ." record-zterm_013.
PERFORM bdc_field USING 'BSEG-ZBD1T'
'30'."record-zbd1t_014.
PERFORM bdc_field USING 'BSEG-ZFBDT'
it_excel-bldat_001."record-zfbdt_015.
PERFORM bdc_field USING 'BSEG-ZUONR'
it_excel-xblnr_007."record-zuonr_016.
PERFORM bdc_field USING 'BSEG-SGTXT'
it_excel-sgtxt_017.
PERFORM bdc_field USING 'RF05A-NEWBS'
'50'." record-newbs_018.
PERFORM bdc_field USING 'RF05A-NEWKO'
it_excel-newko_011." record-newko_019."Gl account
PERFORM bdc_dynpro USING 'SAPMF05A' '0300'.
PERFORM bdc_field USING 'BDC_CURSOR'
'BSEG-SGTXT'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BSEG-WRBTR'
it_excel-wrbtr_012."changes from 12 to 20
PERFORM bdc_field USING 'BSEG-MWSKZ'
it_excel-mwskz." record-mwskz_021.
PERFORM bdc_field USING 'BSEG-ZUONR'
it_excel-xblnr_007." record-zuonr_022.
PERFORM bdc_field USING 'BSEG-SGTXT'
it_excel-sgtxt_017." record-sgtxt_023.
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_CURSOR'
'COBL-PRCTR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'COBL-PRCTR'
it_excel-prctr ." record-prctr_024.
PERFORM bdc_dynpro USING 'SAPMF05A' '0300'.
PERFORM bdc_field USING 'BDC_CURSOR'
'BSEG-WRBTR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=STER'.
PERFORM bdc_field USING 'BSEG-WRBTR'
it_excel-wrbtr_012." it_excel-wrbtr_025.
PERFORM bdc_field USING 'BSEG-MWSKZ'
it_excel-mwskz.
PERFORM bdc_field USING 'BSEG-ZUONR'
it_excel-xblnr_007." record-zuonr_027.
PERFORM bdc_field USING 'BSEG-SGTXT'
it_excel-sgtxt_017." record-sgtxt_028.
PERFORM bdc_field USING 'DKACB-FMORE'
'X' ."record-fmore_029.
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
PERFORM bdc_field USING 'BDC_CURSOR'
'COBL-PARGB'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ENTE'.
PERFORM bdc_field USING 'COBL-PRCTR'
it_excel-prctr." record-prctr_030.
PERFORM bdc_dynpro USING 'SAPLTAX1' '0300'.
PERFORM bdc_field USING 'BDC_CURSOR'
'BSET-FWSTE(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=GOBU'.
PERFORM bdc_field USING 'BSET-FWSTE(01)'
it_excel-wrbtr_025." record-fwste_01_031.
PERFORM bdc_transaction USING 'FB01'.
REFRESH:bdcdata,messtab.
ENDLOOP.
REFRESH:bdcdata.
** PERFORM bdc_dynpro USING 'SAPMF05A' '0100'.
* PERFORM bdc_field USING 'BDC_CURSOR'
* 'RF05A-NEWKO'.
* PERFORM bdc_field USING 'BDC_OKCODE'
* '/00'.
* PERFORM bdc_field USING 'BKPF-BLDAT'
* record-bldat_001.
* PERFORM bdc_field USING 'BKPF-BLART'
* record-blart_002.
* PERFORM bdc_field USING 'BKPF-BUKRS'
* record-bukrs_003.
* PERFORM bdc_field USING 'BKPF-BUDAT'
* record-budat_004.
* PERFORM bdc_field USING 'BKPF-MONAT'
* record-monat_005.
* PERFORM bdc_field USING 'BKPF-WAERS'
* record-waers_006.
* PERFORM bdc_field USING 'BKPF-XBLNR'
* record-xblnr_007.
* PERFORM bdc_field USING 'BKPF-BKTXT'
* record-bktxt_008.
* PERFORM bdc_field USING 'FS006-DOCID'
* record-docid_009.
* PERFORM bdc_field USING 'RF05A-NEWBS'
* record-newbs_010.
* PERFORM bdc_field USING 'RF05A-NEWKO'
* record-newko_011.
* PERFORM bdc_dynpro USING 'SAPMF05A' '0301'.
* PERFORM bdc_field USING 'BDC_CURSOR'
* 'RF05A-NEWKO'.
* PERFORM bdc_field USING 'BDC_OKCODE'
* '/00'.
* PERFORM bdc_field USING 'BSEG-WRBTR'
* record-wrbtr_012.
* PERFORM bdc_field USING 'BSEG-ZTERM'
* record-zterm_013.
* PERFORM bdc_field USING 'BSEG-ZBD1T'
* record-zbd1t_014.
* PERFORM bdc_field USING 'BSEG-ZFBDT'
* record-zfbdt_015.
* PERFORM bdc_field USING 'BSEG-ZUONR'
* record-zuonr_016.
* PERFORM bdc_field USING 'BSEG-SGTXT'
* record-sgtxt_017.
* PERFORM bdc_field USING 'RF05A-NEWBS'
* record-newbs_018.
* PERFORM bdc_field USING 'RF05A-NEWKO'
* record-newko_019.
* PERFORM bdc_dynpro USING 'SAPMF05A' '0300'.
* PERFORM bdc_field USING 'BDC_CURSOR'
* 'BSEG-SGTXT'.
* PERFORM bdc_field USING 'BDC_OKCODE'
* '/00'.
* PERFORM bdc_field USING 'BSEG-WRBTR'
* record-wrbtr_020.
* PERFORM bdc_field USING 'BSEG-MWSKZ'
* record-mwskz_021.
* PERFORM bdc_field USING 'BSEG-ZUONR'
* record-zuonr_022.
* PERFORM bdc_field USING 'BSEG-SGTXT'
* record-sgtxt_023.
* PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
* PERFORM bdc_field USING 'BDC_CURSOR'
* 'COBL-PRCTR'.
* PERFORM bdc_field USING 'BDC_OKCODE'
* '=ENTE'.
* PERFORM bdc_field USING 'COBL-PRCTR'
* record-prctr_024.
* PERFORM bdc_dynpro USING 'SAPMF05A' '0300'.
* PERFORM bdc_field USING 'BDC_CURSOR'
* 'BSEG-WRBTR'.
* PERFORM bdc_field USING 'BDC_OKCODE'
* '=STER'.
* PERFORM bdc_field USING 'BSEG-WRBTR'
* record-wrbtr_025.
* PERFORM bdc_field USING 'BSEG-MWSKZ'
* record-mwskz_026.
* PERFORM bdc_field USING 'BSEG-ZUONR'
* record-zuonr_027.
* PERFORM bdc_field USING 'BSEG-SGTXT'
* record-sgtxt_028.
* PERFORM bdc_field USING 'DKACB-FMORE'
* record-fmore_029.
* PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
* PERFORM bdc_field USING 'BDC_CURSOR'
* 'COBL-PARGB'.
* PERFORM bdc_field USING 'BDC_OKCODE'
* '=ENTE'.
* PERFORM bdc_field USING 'COBL-PRCTR'
* record-prctr_030.
* PERFORM bdc_dynpro USING 'SAPLTAX1' '0300'.
* PERFORM bdc_field USING 'BDC_CURSOR'
* 'BSET-FWSTE(01)'.
* PERFORM bdc_field USING 'BDC_OKCODE'
* '=GOBU'.
* PERFORM bdc_field USING 'BSET-FWSTE(01)'
* record-fwste_01_031.
* PERFORM bdc_transaction USING 'FB01'.
* ENDDO.
PERFORM close_group.
* PERFORM close_dataset USING dataset.
*endif.
*& Form sub_browse_file
* text
* --> p1 text
* <-- p2 text
FORM sub_browse_file .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
* FIELD_NAME = ' '
IMPORTING
file_name = pfile.
ENDFORM. " sub_browse_file
*& Form sub_data_load
* text
* --> p1 text
* <-- p2 text
FORM sub_data_load .
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
* I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw
i_filename = pfile
TABLES
i_tab_converted_data = it_excel[]
* EXCEPTIONS
* CONVERSION_FAILED = 1
* OTHERS = 2
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " sub_data_load
**& Form data_selection
** text
** --> p1 text
** <-- p2 text
*FORM data_selection .
* SELECT * FROM bkpf
* INTO CORRESPONDING FIELDS OF TABLE it_bkpf
* WHERE budat = p_budat AND
* bukrs = p_bukrs.
* IF NOT it_bkpf[] IS INITIAL.
* SELECT belnr dmbtr mwsts pswsl
* FROM bseg INTO TABLE it_bseg
* FOR ALL ENTRIES IN it_bkpf
* WHERE belnr = it_bkpf-belnr AND
* kunnr = p_kunnr AND
* hkont = p_hkont AND
* pswsl = p_waers.
* ENDIF.
*ENDFORM. " data_selection
**& Form data_move
** text
** --> p1 text
** <-- p2 text
*FORM data_move.
* SORT : it_bseg BY belnr,
* it_bkpf BY belnr.
* LOOP AT it_bseg.
* it_final-dmbtr = it_bseg-dmbtr.
* it_final-belnr = it_bseg-belnr.
* it_final-mwsts = it_bseg-mwsts.
* it_final-pswsl = it_bseg-pswsl.
* READ TABLE it_bkpf WITH KEY belnr = it_bseg-belnr BINARY SEARCH.
* IF sy-subrc = 0.
* it_final-budat = it_bkpf-budat.
* it_final-bldat = it_bkpf-bldat.
* it_final-xblnr = it_bkpf-xblnr.
* it_final-bktxt = it_bkpf-bktxt.
* ENDIF.
* APPEND it_final.
* CLEAR it_final.
* ENDLOOP.
*ENDFORM. " data_move
*& Form alv_get_data
* text
* --> p1 text
* <-- p2 text
FORM alv_get_data .
CLEAR it_fieldcat.
***************** Document number
* wa_fieldcat-col_pos = '1'. " ALV O/P COL-1
wa_fieldcat-fieldname = 'XBLNR_007'.
wa_fieldcat-seltext_m = 'Document number'.
wa_fieldcat-just = 'L'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 15.
wa_fieldcat-tabname = 'IT_EXCEL'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
***************** Posting Date
* wa_fieldcat-col_pos = '2'. " ALV O/P COL-1
wa_fieldcat-fieldname = 'BUDAT_004'.
wa_fieldcat-seltext_m = 'Posting Date'.
wa_fieldcat-just = 'L'.
wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 20.
wa_fieldcat-tabname = 'IT_EXCEL'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
******************** Document Date
* wa_fieldcat-col_pos = '3'. " ALV O/P COL-2
wa_fieldcat-fieldname = 'BLDAT_001'.
wa_fieldcat-seltext_m = 'Document Date'.
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'IT_EXCEL'.
wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
********************* REFERENCE DOCUMENT
** wa_fieldcat-col_pos = '4'. " ALV O/P COL-2
* wa_fieldcat-fieldname = 'XBLNR'.
* wa_fieldcat-seltext_m = 'REFERENCE DOCUMENT'.
* wa_fieldcat-just = 'L'.
* wa_fieldcat-tabname = 'IT_EXCEL'.
** wa_fieldcat-outputlen = 15.
* APPEND wa_fieldcat TO it_fieldcat.
* CLEAR wa_fieldcat.
***************** DOCUMENT HEADER TEXT
* wa_fieldcat-col_pos = '5'. " ALV O/P COL-3
wa_fieldcat-fieldname = 'SGTXT_017'.
wa_fieldcat-seltext_m = 'DOCUMENT HEADER TEXT'.
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'IT_EXCEL'.
* wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*******************Invoice Net amount
* wa_fieldcat-col_pos = '6'. " ALV O/P COL-4
wa_fieldcat-fieldname = 'WRBTR_012'.
wa_fieldcat-seltext_m = 'Invoice Net amount'.
wa_fieldcat-just = 'L'.
wa_fieldcat-tabname = 'IT_EXCEL'.
* wa_fieldcat-outputlen = 15.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*********** Tax Amount
* wa_fieldcat-col_pos = '7'. " ALV O/P COL-5
wa_fieldcat-fieldname = 'WRBTR_025'.
wa_fieldcat-seltext_m = 'Tax Amount'.
wa_fieldcat-just = 'L'.
* wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-tabname = 'IT_EXCEL'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*********** NEt Amount
* wa_fieldcat-col_pos = '7'. " ALV O/P COL-5
wa_fieldcat-fieldname = 'WRBTR_020'.
wa_fieldcat-seltext_m = 'Net Amount'.
wa_fieldcat-just = 'L'.
* wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-tabname = 'IT_EXCEL'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
*********** General ledger currency
* wa_fieldcat-col_pos = '7'. " ALV O/P COL-5
wa_fieldcat-fieldname = 'WAERS_006'.
wa_fieldcat-seltext_l = 'General ledger currency'.
wa_fieldcat-just = 'L'.
* wa_fieldcat-no_zero(1) = 'X'.
wa_fieldcat-outputlen = 25.
wa_fieldcat-tabname = 'IT_EXCEL'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
ENDFORM. " alv_get_data
*& Form alv_grid
* text
* --> p1 text
* <-- p2 text
FORM alv_grid .
* PERFORM fill_list_header USING it_top_of_page[].
* PERFORM event-build USING gt_events[].
PERFORM fill_layout USING ls_layout.
MESSAGE 'Please press F3 to generate a session or call transaction method after getting report!' TYPE 'I'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = ls_layout
it_fieldcat = it_fieldcat
it_events = gt_events[]
i_save = 'A'
TABLES
t_outtab = it_excel
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " alv_grid
* FORM FILL_LAYOUT *
FORM fill_layout USING p_ls_layout TYPE slis_layout_alv.
p_ls_layout-zebra = 'X'.
p_ls_layout-cell_merge = 'X'.
ENDFORM. "fill_layout
*& Form sub_calc_excel
* text
* --> p1 text
* <-- p2 text
FORM sub_calc_excel .
data: idate TYPE sy-datum,
tdat8 type string.
LOOP AT it_excel.
CONCATENATE it_excel-blart_002 '/' it_excel-monat_005 '/' it_excel-bktxt_008 INTO
it_excel-sgtxt_017.
it_excel-bukrs_003 = p_bukrs.
* it_excel-budat_004 = p_budat.
it_excel-waers_006 = p_waers.
it_excel-newko_011 = p_hkont.
it_excel-kunnr_019 = p_kunnr.
it_excel-mwskz = p_mwskz.
it_excel-prctr = p_prctr.
idate = p_budat.
CALL FUNCTION 'DATUMSAUFBEREITUNG'
EXPORTING
* FLAGM = ' '
* FLAGW = ' '
IDATE = idate
* IMONT = ' '
* IWEEK = ' '
IMPORTING
* MDAT4 =
* MDAT6 =
* TDAT4 =
* TDAT6 =
TDAT8 = tdat8
* WDAT4 =
* WDAT6 =
* EXCEPTIONS
* DATFM_UNGUELTIG = 1
* DATUM_UNGUELTIG = 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.
it_excel-budat_004 = tdat8.
* CONCATENATE it_excel-budat_004+4(2) '/' it_excel-budat_004+6(2) '/' it_excel-budat_004+0(4)
* INTO it_excel-budat_004.
* SPLIT it_excel-bldat_001 AT '/' INTO it_excel-month it_excel-date.
* CONCATENATE it_excel-date '.' it_excel-month '.' it_excel-bldat_001+6(4) INTO it_excel-bldat_001.
MODIFY it_excel.
CLEAR it_excel.
ENDLOOP.
ENDFORM. " sub_calc_excel
*& Form write
* text
* --> p1 text
* <-- p2 text
*form write .
*OPEN DATASET dataset FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
*data: wa_excel like line of it_excel.
*loop at it_excel into wa_excel.
*TRANSFER wa_excel to dataset.
*endloop.
*CLOSE DATASETdataset.
*endform. " write -
How to change customer reconciliation account in ECC6.0 without new GL fun?
Hi,
We have to default profit center for one customer without disturbing setup for other customer.
Hence we have decided to change reconciliation account of that customer and will assign to acount with default profit center in 3KEI.
Now my question is how to change recon ac of customer having too many line items for that customer.
Please an I get help on this?
Please can you provide steps to hange recon ac by transferring balance to other account?
How we can deal with open/clear line items of that customer.
ThanksHi
A rather simple way will be to set up a simple substitution rule for that particular customer in GGB1. You can write a simple substitution rule as under
Prerequisite:
BKPF-BUKRS=1000 and BSEG-KUNNR=1001112
Substitution
BSEG-PRCTR =101332
You should activate this rule for entire Document
Regards
Sanil Bhandari
Edited by: Sanil K Bhandari on Jun 13, 2011 12:22 PM
Maybe you are looking for
-
Upgrade - SAP will not restart during MAIN_NEWBAS/STARTSAP_NBAS phase
We are upgrading from 4.7 to NW 7.0 (SP#5) SAP will not restart during the phase MAIN_NEWBAS/STARTSAP_NBAS We had to manually apply the kernel (NW 7.2 -#63 - NON UC). This looks OK when we calll DW -version. The T03 system will not start either throu
-
Audio configuration problem in iTunes
I am running iTunes 7.1.1.5 (WinXP). When opening iTunes, I get an error message that there "are problems with your audio configuration." In iTunes support, I followed instructions to remove Quicktime then reinstall as standalone (without iTunes). Sa
-
What is the Best Practice for A1000 LUN Configuration
I have a fully populated 12 X 18GB A1000 array, What is the optimal LUN configuration for a A1000 Array running RAID5 in a read intensive oracle financials environment. 1. 1 (10 X 18GB + 2 X 18GB HS ) (Use format to split at OS level) - Current Setti
-
"java -version" fails in Solaris 5.9 with relocation error
Hi all, Appologies for the Java 'newbie-ness' of this query from the outset... But here goes. My current configuration is ... SunOS 5.9 Generic_112233-11 sun4u sparc SUNW,UltraAX-i2 and I'm trying to run with Java 2 SDK, Standard Edition Version 1.4.
-
Error loading elements 11 tried to uninstall to reinstall error
Premiere 11 loaded fine but not the photoshop 11 & it was missing the enhance panoramic merge option. So I have tried to uninstall but error message keeps popping up. Want to reinstall Elements 11. Help please