Skip to Content
author's profile photo Former Member
Former Member

Get data as FS10N

Hi,

I've tried to create a program using function modulo LDB_PROCESS as std. program: RFGLBALANCE. The problem is that the internal table: lt_balance_data is not filled.

Any idea of what else do I need to do to fill this internal table.

Do you know any other way to get the same data as lt_balance_data which contains an account balance in the different currencies?

*&---------------------------------------------------------------------*
*& Report  ZJMPRUEBA
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zjm_ldb.

START-OF-SELECTION.

  DATA: lt_balance_data  TYPE fdbl_balance_data.

  DATA: lt_params    TYPE STANDARD TABLE OF rsparams WITH HEADER LINE,
        lt_callbacks TYPE STANDARD TABLE OF ldbcb WITH HEADER LINE.

  PERFORM fill_it USING 'SD_BUKRS' 'I' 'EQ' 'OMMA'.
  PERFORM fill_it USING 'SD_SAKNR' 'I' 'EQ' '2030010100'.
  PERFORM fill_it USING 'SD_GJAHR' 'I' 'EQ' '2008'.
  PERFORM fill_it USING 'SD_GSB_S' 'I' 'CP' '*'.
  PERFORM fill_it USING 'SD_CURTP' 'I' 'CP' '10'.
  PERFORM fill_it USING 'SD_RTCUR' 'I' 'CP' '*'.
  PERFORM fill_it USING 'SD_ITUSR' 'I' 'EQ' ''.
  PERFORM fill_it USING 'SD_CURTP' 'I' 'EQ' '10'.


  PERFORM fill_it2 using 'KNC1'.
  PERFORM fill_it2 using 'KNC3'.
  PERFORM fill_it2 using 'LFC1'.
  PERFORM fill_it2 using 'LFC3'.
  PERFORM fill_it2 using 'SKC1C'.

  CALL FUNCTION 'LDB_PROCESS'
    EXPORTING
      ldbname                     = 'SDF'
    TABLES
      callback                    = lt_callbacks
      selections                  = lt_params
    EXCEPTIONS
      ldb_not_reentrant           = 1
      ldb_incorrect               = 2
      ldb_already_running         = 3
      ldb_error                   = 4
      ldb_selections_error        = 5
      ldb_selections_not_accepted = 6
      variant_not_existent        = 7
      variant_obsolete            = 8
      variant_error               = 9
      free_selections_error       = 10
      callback_no_event           = 11
      callback_node_duplicate     = 12
      callback_no_program         = 13
      callback_no_cbform          = 14
      dyn_node_no_type            = 15
      dyn_node_invalid_type       = 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.

*&---------------------------------------------------------------------*
*&      Form  fill_it
*&---------------------------------------------------------------------*
form fill_it  using    P1
                       P2
                       P3
                       P4.

  lt_params-selname = P1.
  lt_params-sign    = P2.
  lt_params-option  = P3.
  lt_params-low     = P4.
  APPEND lt_params.
  CLEAR lt_params.
endform.                    " fill_it

*&---------------------------------------------------------------------*
*&      Form  fill_it2
*&---------------------------------------------------------------------*
form fill_it2  using    p1.
  lt_callbacks-ldbnode = p1.
  lt_callbacks-get = 'X'.
  lt_callbacks-CB_PROG = 'RFGLBALANCE'.
  lt_callbacks-CB_FORM = 'LDB_CALLBACK'.
  APPEND lt_callbacks.
  CLEAR lt_callbacks.
endform.                    " fill_it2

Any help would be appreciated

Edited by: urjose on Apr 10, 2008 4:54 PM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Apr 10, 2008 at 03:29 PM

    Hi,

    Have a look at tables GLT0, GLPCA, GLPCT. Try if you can make a SELECT on one of these tables which corresponds with the output of FS10N.

    Hope it helps you,

    Bert

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 04:39 PM

    Done !

    The way to get data as FS10N is the following:

    REPORT  zjm_ldb message-id FDBL.
    
    include RFBALANCEDATA.
    
    START-OF-SELECTION.
    
      DATA: it_params    TYPE STANDARD TABLE OF rsparams WITH HEADER LINE,
            it_callbacks TYPE STANDARD TABLE OF ldbcb WITH HEADER LINE.
    
      PERFORM fill_it USING 'SD_BUKRS' 'I' 'EQ' 'OMMA'.
      PERFORM fill_it USING 'SD_SAKNR' 'I' 'EQ' '2030010100'.
      PERFORM fill_it USING 'SD_GJAHR' 'I' 'EQ' '2008'.
      PERFORM fill_it USING 'SD_GSB_S' 'I' 'CP' '*'.
      PERFORM fill_it USING 'SD_CURTP' 'I' 'CP' '10'.
      PERFORM fill_it USING 'SD_RTCUR' 'I' 'CP' '*'.
      PERFORM fill_it USING 'SD_ITUSR' 'I' 'EQ' ''.
      PERFORM fill_it USING 'SD_CURTP' 'I' 'EQ' '10'.
    
    
      PERFORM fill_it2 using 'KNC1'.
      PERFORM fill_it2 using 'KNC3'.
      PERFORM fill_it2 using 'LFC1'.
      PERFORM fill_it2 using 'LFC3'.
      PERFORM fill_it2 using 'SKC1C'.
    
      CALL FUNCTION 'LDB_PROCESS'
        EXPORTING
          ldbname                     = 'SDF'
        TABLES
          callback                    = it_callbacks
          selections                  = it_params
        EXCEPTIONS
          ldb_not_reentrant           = 1
          ldb_incorrect               = 2
          ldb_already_running         = 3
          ldb_error                   = 4
          ldb_selections_error        = 5
          ldb_selections_not_accepted = 6
          variant_not_existent        = 7
          variant_obsolete            = 8
          variant_error               = 9
          free_selections_error       = 10
          callback_no_event           = 11
          callback_node_duplicate     = 12
          callback_no_program         = 13
          callback_no_cbform          = 14
          dyn_node_no_type            = 15
          dyn_node_invalid_type       = 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.
    
    *&---------------------------------------------------------------------*
    *&      Form  fill_it
    *&---------------------------------------------------------------------*
    form fill_it  using    P1
                           P2
                           P3
                           P4.
    
      it_params-selname = P1.
      it_params-sign    = P2.
      it_params-option  = P3.
      it_params-low     = P4.
      APPEND it_params.
      CLEAR it_params.
    endform.                    " fill_it
    
    *&---------------------------------------------------------------------*
    *&      Form  fill_it2
    *&---------------------------------------------------------------------*
    form fill_it2  using    p1.
      it_callbacks-ldbnode = p1.
      it_callbacks-get = 'X'.
      it_callbacks-CB_PROG = 'ZJM_LDB'.
      it_callbacks-CB_FORM = 'LDB_CALLBACK'.
      APPEND it_callbacks.
      CLEAR it_callbacks.
    endform.                    " fill_it2
    
    include RFBALANCE.

    LT_BALANCE_DATA has all the data.

    The All Currencies Amount in Local Currency is obtained computing the rows with no flag.

    The Document Currencies Amount is obtained computing the rows with no flag and with the corresponding currency key (EUR, USD, MXP, etc).

    =P

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.