블로그 이미지
모에샹동

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

  • total
  • today
  • yesterday

2009. 5. 22. 14:55 SAP/ABAP,BC

 

DATA: BEGIN OF itab OCCURS 0,

             f1  type i,

             f2  type i,

           END OF itab.

DATA : BEGIN OF ITAB2 OCCURS 0,

          F3 type i.     ---->  ‘마침표’ 임을 주목.

        INCLUDE STRUCTURE itab1.    ---->

여기도 마침표.

DATA : END OF ITAB.

Naver 태그:

posted by 모에샹동
2009. 5. 22. 14:48 SAP/ABAP,BC

********   On-line

clip_image002

MODULE INIT_SCREEN_100 OUTPUT.

  txtplant = p_werks.

  txtdate  = sy-datum.

  txttime  = sy-uzeit.

  txtbigo  = 'N'.

PERFORM LISTBOX_P_MODE_SET.        "실행모드

FORM LISTBOX_P_MODE_SET .

  TYPES: BEGIN OF TY_VRM_VALUE,

            KEY(40) TYPE C,

            TEXT(80) TYPE C,

          END OF TY_VRM_VALUE.

  DATA: LT_VRM_VALUE     TYPE TABLE OF TY_VRM_VALUE,

        LS_VRM_VALUE     TYPE TY_VRM_VALUE,

        L_FNAME          TYPE TY_VRM_VALUE-TEXT.

*-set listbox

  L_FNAME = 'TXTBIGO'.

  LS_VRM_VALUE-KEY  = 'N'.

  LS_VRM_VALUE-TEXT = '주 1회 신규 FSCT 갱신에 의한 변경'.

  APPEND LS_VRM_VALUE TO LT_VRM_VALUE.

  LS_VRM_VALUE-KEY  = 'F'.

  LS_VRM_VALUE-TEXT = 'FCST 추가 변경에 의한 계획 수정'.

  APPEND LS_VRM_VALUE TO LT_VRM_VALUE.

  LS_VRM_VALUE-KEY  = 'T'.

  LS_VRM_VALUE-TEXT = 'Trouble 등에 의한 계획 변경'.

  APPEND LS_VRM_VALUE TO LT_VRM_VALUE.

  SORT LT_VRM_VALUE DESCENDING.

  CALL FUNCTION 'VRM_SET_VALUES'

    EXPORTING

      ID     = L_FNAME

      VALUES = LT_VRM_VALUE.

ENDFORM.                    " LISTBOX_P_MODE_SET

******   Report

PARAMETERS: P_MODE TYPE CHAR1  DEFAULT 'A'  AS LISTBOX

                                            VISIBLE LENGTH 20.

Naver 태그: ,
posted by 모에샹동
2009. 5. 22. 14:40 SAP/PP

1. User-Exit 및 Screen-Exit

2. Table(STKO)에 Customer 필드 추가

.

3. 관련 코딩 내용은 아래 영문 자료 참고

4. 결과

 

* 참고 자료

Activities in the ABAP Workbench

You do not need to modify the database tables for master data and transaction data. The tables contain an include, which is automatically filled with your company-specific fields.

You maintain the include structure for the BOM header or the BOM item, as required.

Include Structures in Database Tables

Database table

Include structure

STKO

(BOM header)

CI_STKO

STPO

(BOM item)

CI_STPO

In the ABAP Workbench:

  • Maintain company-specific fields in the BOM header or BOM item as dictionary objects. Please use names from the name range reserved for customer-specific fields.
    In the ABAP Workbench, choose Dictionary, then select Data elements.
  • Then maintain the include structure for the database table.
    In the ABAP Workbench, choose Dictionary, then select Structures (for example, structure CI_STKO for the BOM header).
    • Enter your company-specific fields.

The fields from the structures are copied to the database tables (STKO and STPO). For this reason, always set new fields at the end of the include structure.

    • Activate the include structure.

When you upgrade your system to the next release, the fields are automatically included in the new "standard" system.

Maintain Enhancement Project

The field enhancements for the BOM header or items comprise several component parts that are managed in an enhancement project.

To maintain an enhancement project:

  1. Create the enhancement project:

– Choose Tools ® ABAP Workbench, then Utilities ® Enhancements ® Project management.

You see the Project Management of SAP Enhancements screen.

– Enter a project name and choose Project ® Create.

You see the Attributes of Enhancement Project screen.

– Enter a Short text and save the project.

  1. Assign the enhancement that is defined in the standard system for BOM processing to this project:

– On the Attributes screen, choose Components.

On the next screen, enter the enhancement for BOM headers or BOM items that has been defined by SAP.

– Enhancement for BOM header: PCSD0003

– Enhancement for BOM item: PCSD0002

  1. Display the enhancement components.

The following overview shows the components that are automatically assigned by the system.

Components for BOM Item Enhancement PCSD0002

Menu option:

SAPLCSDI+002

<customer fields>

Function exits:

EXIT_SAPLCSDI_002

EXIT_SAPLCSDI_003

Customer fields for customer program

Customer fields for SAP program

Screen area:

SAPLCSDI0138_CUSPOS01SAPLXSA1000

Components for BOM Header Enhancement PCSD0003:

Menu option:

SAPLCSDI+003

<customer fields>

Function exits:

EXIT_SAPLCSDI_004

EXIT_SAPLCSDI_005

Customer fields for customer program

Customer fields for SAP program

Screen area:

SAPLCSDI0114_CUSHDR01SAPLXSA1100

  1. Copy the enhancement to your new project.
  2. Process the individual components.

– On the Project Management screen, select Enhancement components. Choose Change.

– Replace the general menu option Customer fields with a company-specific description.

  1. Encode function exit EXIT_SAPLCSDI_002 for transferring R/3 application data to the screen area.

000010function exit_saplcsdi_002.

000020*" *

000030*"*" Local interface:

000040*" IMPORTING

000050*" VALUE(USERDATA) LIKE CSCI_STPO STRUCTURE CSCI_STPO

000060 VALUE(ITEMDATA) LIKE STPOB STRUCTURE STPOB

000070*"--------------------------------------------

000080

000090

000100 include zxcsau02.

000110

000100endfunction.

Edit program zxcsau02.

000010*------------------------------------------------*

000020* INCLUDE ZXCSAU02

000030*-------------------------------------------------*

000040

000050hlp_ci_stpo - userdata.

  1. Encode function exit EXIT_SAPLCSDI_003 for transferring data from the screen area to the R/3 application.

000010function exit_saplcsdi_003.

000020*" *

000030*"*" Local interface:

000040*" EXPORTING

000050*" VALUE(USERDATA) LIKE CSCI_STPO STRUCTURE CSCI_STPO

000060*"--------------------------------------------

000070

000080

000100 include zxcsau03.

000110

000100endfunction.

Edit program zxcsau03.

000010*------------------------------------------------*

000020* INCLUDE ZXCSAU03

000030*-------------------------------------------------*

000040

000050 userdata = help_ci_stpo.

  1. In the Screen Painter, create the screen area for program SAPLXCSA – for example, screen 1000. Customer-specific fields are included in this screen.

- Screen attributes:

Screen type Subscreen

Settings – Hold data

- Settings for screen:

Maintain descriptions for the entry fields on the screen (Edit ® Create element ® Text field).

Insert the entry fields in the screen (Edit ® Create element ® Input/output field).

Assign the entry field on the screen to the corresponding field in the include structure (Goto ® Dict./program fields).

  1. To maintain the include, edit program SAPLXCSA.

Example:

000010*----------------------------------------------------------*

000020* INCLUDE ZXCSATOP *

000030*----------------------------------------------------------*

000040tables: ci_stpo.

000050

000060data: hlp_ci_stpo like csci_stpo.

  1. In the Screen Painter, program the flow logic for the screen for program SAPLXCSA – for example, screen 1000.

Example:

000010process before output.

000020module status_1000.

000030*

000040process after input.

000050

000060 chain.

000070 field:ci_stpo-feld_1,

000080 ci_stpo-feld_2,

000090 ci_stpo-feld_3.

000100 module user_command_1000 on chain-request.

000110 endchain.

The chain statement is only executed if the fields in the chain have changed. If there is only one field, only the statement on request is used.

Edit a program that is processed before output (PBO).

Example:

000010module status_1000 output.

000020

000030ci_stpo = hlp_ci_stpo.

000050

000060endmodule. "STATUS_1000 OUTPUT

Edit a program that is processed after input (PAI).

Example:

000010module user_command_1000 input.

000020

000030hlp_ci_stpo = ci_stpo.

000050

000060endmodule. "USER_COMMAND_1000 INPUT

  1. Once you have created the menu option and programmed the function modules and screen area, you can activate the company-specific enhancement project on the Project Management screen. When you activate the enhancement, the BOM program is regenerated, so the call is active.
posted by 모에샹동
2009. 5. 21. 17:17 SAP/ABAP,BC

해당월의 마지막일자.

CALL FUNCTION 'BKK_GET_MONTH_LASTDAY'
  EXPORTING
    I_DATE        = R_BUDAT-LOW
  IMPORTING
    E_DATE        = R_BUDAT-HIGH.

 

해당일자의 standard week

CALL FUNCTION 'DATE_GET_WEEK'
        EXPORTING
           date = SY-DATUM
        IMPORTING
           week = L_SPWEK. 


해당 주차의 월요일 구하기

CALL FUNCTION 'WEEK_GET_FIRST_DAY'
    EXPORTING
      week         = P_EWEEK
    IMPORTING
      date         = p_date3
    EXCEPTIONS
      week_invalid = 1
      OTHERS       = 2.

 
해당일자의 분기시작일 끝일

CALL FUNCTION 'BKK_GET_QUARTER_DATE'
  EXPORTING
    i_date          = i_datum
  IMPORTING
    e_quarter_start = t_m1date                  " 분기시작일
    e_quarter_end   = t_m3date.                 " 분기종료일
posted by 모에샹동