Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Function Module to get Financial Statement Version

Hi,

I want to get the Financial statement Version in (FSE2 Tcode)

Kindly give some idea if there is any functional module is there

Thanks & Regards,

John Victor

Tags:
Former Member
Former Member replied

Hi,

Try this program.

REPORT ztemp_estructura_balance MESSAGE-ID fe.

TYPE-POOLS:

fibs.

TABLES: t011, rfgbst.

TYPES:

t_flag TYPE c,

t_bs_node_id TYPE fibs_bs_node_id,

t_bs_node_tab TYPE t_bs_node_id OCCURS 50,

t_bs_type TYPE i.

TYPES:

BEGIN OF t_bs_info,

  • info about BS given out to clients

ktopl LIKE t011-ktopl,

xauto LIKE t011-xauto,

type TYPE t_bs_type,

END OF t_bs_info.

CONSTANTS:

true TYPE t_flag VALUE 'X',

false TYPE t_flag VALUE ' '.

DATA: versn LIKE t011-versn VALUE 'CTIY'.

DATA: node_tab LIKE snodetext OCCURS 0 WITH HEADER LINE.

DATA: bs_info TYPE t_bs_info.

SELECT SINGLE * FROM t011

WHERE versn = versn.

  • Load the structure from DB

PERFORM load_versn

USING versn.

  • Create the node table for the function module displaying the tree

PERFORM create_node_tab

TABLES node_tab.

WRITE 'Hello'.

&----


  • Load the version (again) *

----


FORM load_versn

USING versn.

  • Load the version

CALL FUNCTION 'FI_BS_LOAD'

EXPORTING

version = versn

IMPORTING

bs_info = bs_info.

  • Load the texts

PERFORM load_versn_text.

ENDFORM. " LOAD_VERSN

&----


*& Form LOAD_VERSN_TEXT

&----


  • Load the texts of the version *

----


FORM load_versn_text.

DATA:

flg_langu_maint TYPE t_flag VALUE false,

flg_sylangu_not_found TYPE t_flag,

maint_langu LIKE sy-langu.

CALL FUNCTION 'FI_BS_LOAD_LANGU'

EXPORTING

flg_langu_maint = flg_langu_maint

IMPORTING

flg_sylangu_not_found = flg_sylangu_not_found

maint_langu = maint_langu

EXCEPTIONS

OTHERS = 1.

  • if maintenance language was loaded, because sy-langu was not found

IF flg_sylangu_not_found = true.

MESSAGE s741 WITH sy-langu maint_langu.

ENDIF.

  • if maintenance language is wanted, but is different from SY-LANGU

  • tell him

IF flg_langu_maint = true AND

maint_langu sy-langu.

MESSAGE s742 WITH maint_langu versn.

ENDIF.

ENDFORM. " LOAD_VERSN_TEXT

&----


*& Form CREATE_NODE_TAB

&----


  • text *

----


FORM create_node_tab

TABLES node_tab STRUCTURE node_tab.

REFRESH node_tab.

DATA:

root_id TYPE t_bs_node_id.

  • Get the root

CALL FUNCTION 'FI_BS_GET_ROOT'

IMPORTING

root_id = root_id

EXCEPTIONS

not_found = 01.

  • Recursively add nodes

PERFORM add_node_with_subtree

TABLES node_tab

USING 1

root_id.

ENDFORM. " CREATE_NODE_TAB

&----


*& Form ADD_NODE_WITH_SUBTREE

&----


  • Recursively add a node with its subtree *

----


FORM add_node_with_subtree

TABLES node_tab STRUCTURE node_tab

USING value(level) TYPE i

value(node_id) TYPE t_bs_node_id.

DATA:

children_node_tab TYPE t_bs_node_tab WITH HEADER LINE.

  • Get the display info

CALL FUNCTION 'FI_BS_NODE_GET_SNODETEXT'

EXPORTING

node_id = node_id

with_gl_accounts = rfgbst-glac_on

IMPORTING

attr = node_tab

EXCEPTIONS

node_not_found = 01.

node_tab-tlevel = level.

APPEND node_tab.

  • And do the same for its children

level = level + 1.

CALL FUNCTION 'FI_BS_NODE_GET_CHILDREN'

EXPORTING

node = node_id

with_gl_accounts = rfgbst-glac_on

TABLES

children_node_tab = children_node_tab

EXCEPTIONS

node_not_found = 01.

LOOP AT children_node_tab.

PERFORM add_node_with_subtree

TABLES node_tab

USING level

children_node_tab.

ENDLOOP.

ENDFORM. " ADD_NODE_WITH_SUBTREE

Thanks,

Sree.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question