Monday, September 26, 2011

GL Account Long Text Number

Refer to table  SKAT - GL account long text number














SAP-FICO: Company Codes and the Chart of Accounts

SAP-FICO: Company Codes and the Chart of Accounts

ConfigurationThough you can have multiple Charts of Accounts in SAP, company codes are assigned to only one chart of accounts. This is done in configuration (SPRO) (T-code: OB62 – Assign Company Code -> Chart of Accounts).
T-Code for Chart of Accounts
  • T-code: F.10 – Chart of Accounts
    Report of accounts in a chart of accounts. Lots of ways to limit your results, but can’t limit by Company Code! You will definitely want to limit by chart of accounts.
  • T-code: OB62 – Assign Company Code -> Chart of Accounts
    SAP: OBY2
  • T-code: OBY2 – Copy Company Code: G/L Accounts
    When creating a new Company Code, just assigning it to a chart of accounts in OB62 doesn’t automatically create those accounts for the new company code. I.e. you won’t be able to post any entries until you’ve created the accounts for the company code. OBY2 lets you copy all of the accounts that were created for another company code to your new one.
  • GL Postings are assigned to only 1 company code
    You can do “cross-company code” postings (i.e. DR CoCde A and CR CoCde B), but SAP will automatically generate the off-setting entries within each company code so that their books stay in balance (debits = credits). There is config around Intra-company postings to determine where you want those offsets to go.
  • T-code: FS00 – Edit G/L Account Centrally
    This is usually the preferred t-code for manually creating GL Accounts since it allows you to create both the chart of accounts piece and the company code pieces.
  • In FS00, you may need to create an account for multiple company codes. This can be done by changing the CoCde and using the “Create with reference button” in FS00.
    SAP: FS00
  • T-code: FSS0 – Edit Accounts in Company Code
    FSS0 allows you to edit just the Company Code (CoCde) portion of the GL Account.
  • T-code: FSP0 – Edit Account in Chart of Accounts
    FSP0 allows you to edit just the Chart of Accounts portion of the GL Account.
  • T-code: CX16 - Consolidation Chart of Accounts – Hierarchy Display
    CX16 allows you to create/edit financial statement items (FS Items) and their hierarchy for the Consolidated Chart of Accounts used in the EC-CS consolidation system.
    SAP: CX16

Credit to : http://www.whypad.com/posts/sap-fico-company-codes-and-the-chart-of-accounts/81/

Sunday, September 25, 2011

CSV: Comma Delimited

Use the Function Module SAP_CONVERT_TO_CSV_FORMAT
to convert the internal table into Comma seperated format then download this

Tuesday, September 20, 2011

Donwnload File - Dynamic Filename

Below is the code snippet

The type should be String as Character(C) data type will generate error 

DATA: l_filename TYPE STRING. 

CONCATENATE 'c:\MPF_REPORT' sy-datum sy-timlo sy-uname '.pdf' INTO l_filename.
CONDENSE l_filename.

CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
*   BIN_FILESIZE                    =
    FILENAME                        = l_filename "'c:\MPF_REPORT20110921063337.pdf' "'c:\test_pdf_sf.pdf'
    FILETYPE                        = 'BIN'
*   APPEND                          = ' '
*   WRITE_FIELD_SEPARATOR           = ' '
*   HEADER                          = '00'
*   TRUNC_TRAILING_BLANKS           = ' '
*   WRITE_LF                        = 'X'
*   COL_SELECT                      = ' '
*   COL_SELECT_MASK                 = ' '
*   DAT_MODE                        = ' '
*   CONFIRM_OVERWRITE               = ' '
*   NO_AUTH_CHECK                   = ' '
*   CODEPAGE                        = ' '
*   IGNORE_CERR                     = ABAP_TRUE
*   REPLACEMENT                     = '#'
*   WRITE_BOM                       = ' '
*   TRUNC_TRAILING_BLANKS_EOL       = 'X'
*   WK1_N_FORMAT                    = ' '
*   WK1_N_SIZE                      = ' '
*   WK1_T_FORMAT                    = ' '
*   WK1_T_SIZE                      = ' '
*   WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
*   SHOW_TRANSFER_STATUS            = ABAP_TRUE
* IMPORTING
*   FILELENGTH                      =
  TABLES
    DATA_TAB                        =  i_pdf
*   FIELDNAMES                      =
* EXCEPTIONS
*   FILE_WRITE_ERROR                = 1
*   NO_BATCH                        = 2
*   GUI_REFUSE_FILETRANSFER         = 3
*   INVALID_TYPE                    = 4
*   NO_AUTHORITY                    = 5
*   UNKNOWN_ERROR                   = 6
*   HEADER_NOT_ALLOWED              = 7
*   SEPARATOR_NOT_ALLOWED           = 8
*   FILESIZE_NOT_ALLOWED            = 9
*   HEADER_TOO_LONG                 = 10
*   DP_ERROR_CREATE                 = 11
*   DP_ERROR_SEND                   = 12
*   DP_ERROR_WRITE                  = 13
*   UNKNOWN_DP_ERROR                = 14
*   ACCESS_DENIED                   = 15
*   DP_OUT_OF_MEMORY                = 16
*   DISK_FULL                       = 17
*   DP_TIMEOUT                      = 18
*   FILE_NOT_FOUND                  = 19
*   DATAPROVIDER_EXCEPTION          = 20
*   CONTROL_FLUSH_ERROR             = 21
*   OTHERS                          = 22
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Sunday, June 12, 2011

Custom Input Help

Below is the custom help for selection options we need to define s-low and s-high withe separated input help

    SELECT t588b~massn
     INTO CORRESPONDING FIELDS OF TABLE i_acthelp
    FROM t588b
    WHERE t588b~USERG = '14'
    AND t588b~massn NE ''.

  LOOP AT i_acthelp.
    SELECT SINGLE mntxt FROM t529t INTO i_acthelp-mntxt
      WHERE  sprsl ='EN' AND
       massn = i_acthelp-massn.
      MODIFY i_acthelp.
  ENDLOOP.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
*     DDIC_STRUCTURE         = ' '
      RETFIELD               = 'MASSN'
*     PVALKEY                = ' '
*     DYNPPROG               = ' '
*     DYNPNR                 = ' '
*     DYNPROFIELD            = ' '
*     STEPL                  = 0
     WINDOW_TITLE           =  'Action Type'
*     VALUE                  = ' '
     VALUE_ORG              = 'S'
*     MULTIPLE_CHOICE        = ' '
*     DISPLAY                = ' '
*     CALLBACK_PROGRAM       = ' '
*     CALLBACK_FORM          = ' '
*     CALLBACK_METHOD        =
*     MARK_TAB               =
*   IMPORTING
*     USER_RESET             =
    TABLES
      VALUE_TAB              = i_acthelp
*     FIELD_TAB              =
     RETURN_TAB             =  it_return
*     DYNPFLD_MAPPING        =
*   EXCEPTIONS
*     PARAMETER_ERROR        = 1
*     NO_VALUES_FOUND        = 2
*     OTHERS                 = 3
            .
  IF SY-SUBRC <> 0.
* Implement suitable error handling here
  ENDIF.

  READ TABLE it_return INTO wa_return INDEX 1.
  S_ACTYPE = wa_return-fieldval.

Saturday, June 4, 2011

ABAP to Excel - with formula

If you guys looking for exporting your data into excel.  Please consider this abap2xlsx .
Its based on XML technologies.

Checkout the details after the next link leap below

http://www.plinky.it/blog/2010/07/12/abap2xlsx-%E2%80%93-generate-your-professional-excel-spreadsheet-from-abap/#axzz1OArZdRLC

https://cw.sdn.sap.com/cw/groups/abap2xlsx

New Link :

http://wiki.scn.sap.com/wiki/display/ABAP/Excel+with+SAP+-+An+overview