Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

FY variant

Former Member
0 Likes
994

If you enter a posting date of, say, 31.07.2007 and a posting period of period 7 when in reality it is period 8 the system will redetermine by checking against the FY Variant. The default is then overwritten and the system offers a message "Posting Period amended in line with posting date XX.XX.XXXX". Therefore, the default posting period the system should offer should take the posting date, determine the period using the FY Variant and place that in the batch input.

How to check against FY variant, any standard function modules to do this.

If you enter a posting date of, say, 31.07.2007 and a posting period of period 7 when in reality it is period 8 the system will redetermine by checking against the FY Variant. The default is then overwritten and the system offers a message "Posting Period amended in line with posting date XX.XX.XXXX". Therefore, the default posting period the system should offer should take the posting date, determine the period using the FY Variant and place that in the batch input.

How to check against FY variant, any standard function modules to do this.

4 REPLIES 4
Read only

Former Member
0 Likes
831

chk the FM G_POSTING_DATE_OF_PERIOD_GET

Read only

0 Likes
831

This will give me posting date of period, I want to do the reverse, period of the posting date, any pointers please.

Read only

Former Member
0 Likes
831

Hi,

HR_PAYROLL_PERIODS_GET, Get the payroll period for a particular date

Regards

Sudheer

Read only

Former Member
0 Likes
831

PLeas go to se 38 and open the program SAPMF05A .... in find put

MODULE periode_pruefen. so that it will show the code of the period reset based on the posting date .... you can see the code which was the setting of the posting period based on the FI->Fiscal year varient for Company code .....



                                                     	7	MODULE periode_pruefen.
                                                   	8	  DATA: s_monat LIKE bkpf-monat.       "Save field for input period
                                                   	9	  DATA: s_anzbp LIKE t009-anzbp.       "Save field for input period
                                                   	10	*
                                                   	11	* Geschäftsjahr wird zum PBO aus SY-DATUM berechnet. Beim Zurückbuchen
                                                   	12	* muß es zuerst neu aus dem Buchungsdatum berechnet werden
                                                   	13	*
                                                   	14	  CLEAR bkpf-gjahr.
                                                   	15	* Check: if no messages is displayed, then check for customized msg.
                                                   	16	  CLEAR char(1).                                            "Note504553
                                                   	17
                                                   	18	*-------- Beim Buchungskreisübergreifenden Buchen: Monat neu ermitteln -
                                                   	19	  IF sy-dynnr = '0600'.
                                                   	20	*   or sy-dynnr = '1050'.
                                                   	21	*   Do nothing(!) in ENJOY as check is already in SAPLFSKB
                                                   	22	    if bkpf-ldgrp <> space.
                                                   	23	      data: ld_organizational_info type GLX_ORG_INFO.          "/glflex/
                                                   	24	      data: ld_monat type poper.
                                                   	25	      CALL FUNCTION 'G_GET_ORGANIZATIONAL_DATA'
                                                   	26	        EXPORTING
                                                   	27	          i_rldnr             = g_group_ledger
                                                   	28	          i_orgunit           = bkpf-bukrs
                                                   	29	        IMPORTING
                                                   	30	          organizational_info = ld_organizational_info.
                                                   	31	    endif.                                                      "/glflex/
                                                   	32	    CALL FUNCTION 'FI_PERIOD_INFO_GET'
                                                   	33	      EXPORTING
                                                   	34	        i_bukrs = tax-bukrs
                                                   	35	*        i_periv = ld_organizational_info-periv                
                                                   	36	      IMPORTING
                                                   	37	        e_anzbp = s_anzbp.
                                                   	38	*             E_ANZSP =   .
                                                   	39	* Buchung erfolgt in einer 
                                                   	40	    IF s_anzbp < bkpf-monat.
                                                   	41	      MESSAGE w146(f5a).
                                                   	42	    ELSE.
                                                   	43	      CLEAR bkpf-monat.
                                                   	44	    ENDIF.
                                                   	45	  ENDIF.
                                                   	46
                                                   	47
48	* Change withdrawn                                          "ALRK258168
49	* If posting is recurring entry, set posting date from      "ALRK226366
50	* start date here. It is too late in RW_PRUEFUNG_POS.       "ALRK226366
51	* (del) if bkpf-bstat = 'D'.                     "ALRK226366 ALRK258168
52	* (del)   clear bkpf-monat.                      "ALRK226366 ALRK258168
53	* (del)   bkpf-budat = bkdf-dbatr.               "ALRK226366 ALRK258168
54	* (del) endif.                                   "ALRK226366 ALRK258168
55
56	  s_monat = bkpf-monat.
57	*
58	* Determine posting period
59	*
60	  PERFORM periode_ermitteln USING bkpf-budat
61	                                  g_group_ledger                 "/glflex/
62	                                  bkpf-gjahr
63	                                  bkpf-monat.
64	* allow carryforward postings in period 0
65	  if tcode = 'FBCB'
66	  and s_monat = 0.
67	* send A-message if ledger group missing in document (eg. flexgl not
68	* active)
69	    if bkpf-ldgrp = space.
70	      message a067(fagl_mig).
71	    endif.
72	    bkpf-monat = s_monat.
73	  endif.
74	*
75	* If period is initial, it will be determined by the system
76	*
77	  IF  NOT s_monat IS INITIAL
78	  AND     s_monat NE bkpf-monat
79	  AND ( sy-binpt = space AND sy-calld = space ).
80	    CALL FUNCTION 'CUSTOMIZED_MESSAGE'                     "Note 386318
81	      EXPORTING                                            "Note 386318
82	        i_arbgb = 'F5'                                     "Note 386318
                                                   	83	        i_dtype = 'W'                                      "Note 386318
                                                   	84	        i_msgnr = '000'                                    "Note 386318
                                                   	85	        i_var01 = s_monat                                  "Note 386318
                                                   	86	        i_var03 = bkpf-monat                               "Note 389708
                                                   	87	        i_var02 = bkpf-budat.                              "Note 386318
                                                   	88	*------- For message cross reference --------------------- "Note 386318
                                                   	89	    IF 1 = 2.                                              "Note 386318
                                                   	90	      MESSAGE w000 WITH s_monat bkpf-budat bkpf-monat.
                                                   	91	    ENDIF.                                                 "Note 386318
                                                   	92	  ENDIF.
                                                   	93	*
                                                   	94	  IF  t020-funcl = char_t
                                                   	95	  AND bkpf-budat = *bkpf-budat
                                                   	96	  AND bkpf-monat = *bkpf-monat.
                                                   	97	    refe = bkpf-gjahr  * 100 + bkpf-monat.
                                                   	98	    SELECT * FROM t001b WHERE rrcty = char_0
                                                   	99	                        AND   bukrs = t001-opvar.                "#EC *
                                                   	100	      refe1 = t001b-frye1 * 100 + t001b-frpe1.
                                                   	101	      refe2 = t001b-toye1 * 100 + t001b-tope1.
                                                   	102	      refe3 = t001b-frye2 * 100 + t001b-frpe2.
                                                   	103	      refe4 = t001b-toye2 * 100 + t001b-tope2.
                                                   	104	      IF refe < refe1
                                                   	105	      OR refe > refe2.
                                                   	106	        IF refe < refe3
                                                   	107	        OR refe > refe4.
                                                   	108	          MESSAGE w428.                                          "#EC *
                                                   	109	          char(1) = 'X'. "Do not show Customized_msg.       "Note504553
                                                   	110	          EXIT.
                                                   	111	        ENDIF.
                                                   	112	      ENDIF.
                                                   	113	    ENDSELECT.                                                   "#EC *
                                                   	114
                                                   	115	  ENDIF.
                                                   	116	  PERFORM periode_pruefen.
                                                   	117	  PERFORM belegdatum_pruefen.
                                                   	118
                                                   	119	*------ Able to change Date (BLDAT,BUDAT,MONAT) in held documents -----
                                                   	120	  IF t020-funcl = char_t AND char(1) EQ space.              "Note504553
                                                   	121	    CALL FUNCTION 'CUSTOMIZED_MESSAGE'                      "Note504553
                                                   	122	      EXPORTING                                             "Note504553
                                                   	123	        i_arbgb = 'F5A'                                     "Note504553
                                                   	124	        i_dtype = '-'                                       "Note504553
                                                   	125	        i_msgnr = '360'.                                    "Note504553
                                                   	126	  ENDIF.                                                    "Note504553
                                                   	127	ENDMODULE.                    "periode_pruefen


Girish