Application Development 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: 

QM Block not triggered via EDI orders

Former Member
0 Kudos

Hello All,

Please help me with this problem "QM block not triggered via EDI Orders".

Sales Orders will be created using IDOC. When the sales orders was displayed using VA02, goto >> items >> schedule lines, there's no QM status violated being displayed in the delivery block column.

Kindly help me what logic will I applied regarding this matter.

FM used was IDOC_INPUT_ORDERS.

I need your comments/suggestions ASAP.

Thanks in advance.

Carina

2 REPLIES 2

Former Member
0 Kudos

hai,

Just check this it may help tou.

Program Name : YX30_UPLOAD_QUALITY_INFO

  • Quality Info Record for I30 System *

  • *

************************************************************************

  • Original Transport Number : I30K903055 *

************************************************************************

  • SYS id: SYS_30_1502_03_41_Upload Quality Info Records *

  • TDS id: TD_30_1502_03_41_Upload Quality Info Records *

  • UT ID: UT_30_1502_03_41_Upload Quality Info Records *

======================================================================

  • Change History *

----


  • Date | Change No | Name | Description *

----


  • yyyy/mm/dd | AAAYYYYMMDD | xxxxxxxxxxxx | *

************************************************************************

REPORT YX30_UPLOAD_QUALITY_INFO MESSAGE-ID yx30_conversions

no standard page heading line-size 255.

include yx30_upload_quality_info_top. "Include for Variable Declaration & Selection Screen

include yx30_upload_quality_info_data. "Include for File read & Authority Check

&----


*& At Selection Screen Output *

&----


AT SELECTION-SCREEN OUTPUT. "PBO

PERFORM fill_parameters.

&----


*& Start Of Selection Event *

&----


start-of-selection.

Perform Authority_check. "Subroutine for authority check

Perform prepare_file. "Subroutine for preparing file

perform file_read. "Subroutine for File read

perform update_qi01. "Subroutine for Uploading data

perform write_error_log1. "Subroutine for writing error log

&----


*& Form write_error_log

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


&----


*& Include YX30_UPLOAD_QUALITY_INFO_TOP

&----


  • Type Declaration

Types: Begin of type_qtyinf,

matnr type matnr, "Material No

lieferant type char10, "Vendor

werk type werks_d, "Plant

frei_dat type char10, "Frei_Dat

stsma type char8, "Stsma

anwso_01 type char1, "ANWSO(01)

anwso_02 type char1, "ANWSO(02)

anwso_03 type char1, "ANWSO(03)

end of type_qtyinf.

  • Internal Table Declaration

Data: itab_qtyinf type standard table of type_qtyinf. "Internal table for QTYINF.

  • Work Area Declaration

Data: wa_qtyinf type type_qtyinf. "Work Area for QTYINF.

  • Variable Declaration

Data: v_file_qtyinf type string, "Source File Name

v1 type string,

v2 type string,

v3 type string,

v_file_return type string,

v_lin TYPE n.

*Selection Screen Declaration

----


  • selection-screen *

----


SELECTION-SCREEN BEGIN OF BLOCK blk1

WITH FRAME TITLE text-s01.

PARAMETER:

p_sysid(3) TYPE c OBLIGATORY , "Source System

p_bukrs(4) TYPE c OBLIGATORY , "Source CompCode

p_samshr type char30 lower case obligatory default '/sap_upload/' , "Samba Share Drive

p_object TYPE CHAR10 OBLIGATORY default 'MAT' . "Migration Data Object

SELECTION-SCREEN END OF BLOCK blk1.

SELECTION-SCREEN SKIP 3.

PARAMETER:

cb_pfill TYPE c AS CHECKBOX DEFAULT 'X' . "Prefill values?

SELECTION-SCREEN COMMENT /1(79) text-s1a.

SELECTION-SCREEN BEGIN OF BLOCK blk3

WITH FRAME TITLE text-s03.

PARAMETER:

pa_filn1(500) TYPE c LOWER CASE

VISIBLE LENGTH 50 , "Filename AppServer

pa_dlimt TYPE c DEFAULT ';' . "Field Delimter

SELECTION-SCREEN END OF BLOCK blk3.

include bdcrecx1. "Include for the subroutine

&----


*& Include YX30_UPLOAD_QUALITY_INFO_DATA

&----


&----


*& Form file_read

&----


  • Subroutine for reading the source file into internal table

----


  • --> p1 text

  • <-- p2 text

----


FORM file_read .

DATA:

single_line TYPE string .

*-- read file, split lines into fields and put data into table

OPEN DATASET v_file_qtyinf FOR INPUT IN TEXT MODE ENCODING NON-UNICODE. "Opening the files

IF sy-subrc EQ 0.

DO.

READ DATASET v_file_qtyinf INTO single_line. "Reading the content of file into line

IF sy-subrc = 0.

IF sy-index > 1. "skip header-line

SPLIT "Split the content of line into work area

single_line

AT ';'

INTO

wa_qtyinf-matnr "Material No

wa_qtyinf-lieferant "Vendor

wa_qtyinf-werk "Plant

wa_qtyinf-frei_dat "Frei Date

wa_qtyinf-stsma "STSMA

wa_qtyinf-anwso_01 "ANWSO_01

wa_qtyinf-anwso_02 "ANWSO_02

wa_qtyinf-anwso_03. "ANWSO_03

APPEND wa_qtyinf TO itab_qtyinf. "Appending Work Area to internal table

ENDIF.

ELSE.

EXIT.

ENDIF.

ENDDO.

CLOSE DATASET v_file_qtyinf. "Closing the files

ELSE.

MESSAGE e015 .

ENDIF.

DESCRIBE TABLE itab_qtyinf LINES v_lin.

IF v_lin LT 0.

MESSAGE e016 .

ENDIF.

ENDFORM. " file_read

&----


*& Form fill_parameters

&----


  • Subroutine for getting the file name

----


FORM fill_parameters .

IF cb_pfill = 'X'.

  • Preparing QTYINF File

CONCATENATE p_sysid '_forward' INTO v3.

CONCATENATE p_sysid '_QTYINF_' p_bukrs '.CSV' INTO v2.

CONCATENATE p_samshr v3 '/' p_object '/' v2 INTO pa_filn1.

ENDIF.

ENDFORM. " fill_parameters

&----


*& Form Authority_check

&----


  • Authority Check

----


  • --> p1 text

  • <-- p2 text

----


FORM authority_check .

  • Authority Check For the Migration

AUTHORITY-CHECK OBJECT 'YX30_MIGR'

ID 'SYSTEM' FIELD p_sysid

ID 'BUKRS' FIELD p_bukrs

ID 'YX30_DMOBJ' FIELD p_object

ID 'ACTVT' FIELD '16'.

IF sy-subrc <> 0.

MESSAGE e010 WITH p_sysid p_bukrs p_object.

ENDIF.

ENDFORM. " Authority_check

&----


*& Form prepare_file

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM prepare_file .

CONCATENATE p_sysid '_forward' INTO v3.

CONCATENATE p_sysid '_QTYINF_' p_bukrs '.CSV' INTO v2.

CONCATENATE p_samshr v3 '/' p_object '/' v2 INTO v_file_qtyinf.

CLEAR v3.

CLEAR v2.

  • Prepare Return File

CONCATENATE p_sysid '_forward' INTO v3.

CONCATENATE p_sysid '_RETRUN_LOG_' p_bukrs '.CSV' INTO v2.

CONCATENATE '/sap_upload/' v3 '/' 'MAT' '/' v2 INTO v_file_return.

ENDFORM. " prepare_file

&----


*& Form update_qi01

&----


  • text

----


FORM update_qi01.

PERFORM open_group. "Opening a session

CLEAR wa_qtyinf.

LOOP AT itab_qtyinf INTO wa_qtyinf.

PERFORM bdc_dynpro USING 'SAPMQBAA' '0100'. "Subroutine for mapping data

PERFORM bdc_field USING 'BDC_CURSOR'

'QINF-MATNR'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'QINF-MATNR'

wa_qtyinf-matnr. "Mapping the material

PERFORM bdc_field USING 'QINF-LIEFERANT'

wa_qtyinf-lieferant. "Mapping the vendor

PERFORM bdc_field USING 'QINF-WERK'

wa_qtyinf-werk. "Mapping the plant

PERFORM bdc_dynpro USING 'SAPMQBAA' '0101'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=STAN'.

PERFORM bdc_field USING 'QINF-FREI_DAT'

wa_qtyinf-frei_dat.

PERFORM bdc_field USING 'BDC_CURSOR'

'QINF-STSMA'.

PERFORM bdc_field USING 'QINF-STSMA'

wa_qtyinf-stsma. "Mapping the status

PERFORM bdc_dynpro USING 'SAPLBSVA' '0201'.

PERFORM bdc_field USING 'BDC_CURSOR'

'J_STMAINT-ANWSO(01)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=OKAY'.

IF wa_qtyinf-anwso_01 = 'X'.

PERFORM bdc_field USING 'J_STMAINT-ANWSO(01)'

wa_qtyinf-anwso_01. "Mapping the anwso(01)

ELSEIF wa_qtyinf-anwso_02 = 'X'.

PERFORM bdc_field USING 'J_STMAINT-ANWSO(02)'

wa_qtyinf-anwso_02. "Mapping the anwso(02)

ELSEIF wa_qtyinf-anwso_03 = 'X'.

PERFORM bdc_field USING 'J_STMAINT-ANWSO(03)'

wa_qtyinf-anwso_03. "Mapping the anwso(03)

ELSEIF wa_qtyinf-anwso_01 = 'X' AND wa_qtyinf-anwso_02 = 'X'.

PERFORM bdc_field USING 'J_STMAINT-ANWSO(01)'

wa_qtyinf-anwso_01.

PERFORM bdc_field USING 'J_STMAINT-ANWSO(02)'

wa_qtyinf-anwso_02.

ELSEIF wa_qtyinf-anwso_01 = 'X' AND wa_qtyinf-anwso_03 = 'X'.

PERFORM bdc_field USING 'J_STMAINT-ANWSO(01)'

wa_qtyinf-anwso_01.

PERFORM bdc_field USING 'J_STMAINT-ANWSO(03)'

wa_qtyinf-anwso_03.

ELSEIF wa_qtyinf-anwso_02 = 'X' AND wa_qtyinf-anwso_03 = 'X'.

PERFORM bdc_field USING 'J_STMAINT-ANWSO(02)'

wa_qtyinf-anwso_02.

PERFORM bdc_field USING 'J_STMAINT-ANWSO(03)'

wa_qtyinf-anwso_03.

ELSEIF wa_qtyinf-anwso_01 = 'X' AND wa_qtyinf-anwso_02 = 'X' AND wa_qtyinf-anwso_03 = 'X'.

PERFORM bdc_field USING 'J_STMAINT-ANWSO(01)'

wa_qtyinf-anwso_01.

PERFORM bdc_field USING 'J_STMAINT-ANWSO(02)'

wa_qtyinf-anwso_02.

PERFORM bdc_field USING 'J_STMAINT-ANWSO(03)'

wa_qtyinf-anwso_03.

ENDIF.

PERFORM bdc_dynpro USING 'SAPMQBAA' '0101'.

PERFORM bdc_field USING 'BDC_CURSOR'

'QINF-FREI_DAT'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=QMBU'.

PERFORM bdc_field USING 'QINF-FREI_DAT'

wa_qtyinf-frei_dat.

PERFORM bdc_field USING 'QINF-STSMA'

wa_qtyinf-stsma.

PERFORM bdc_transaction USING 'QI01'.

ENDLOOP.

PERFORM close_group. "Closing the session

ENDFORM. "update_qi01

&----


*& Form write_error_log

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM write_error_log1 .

DATA:

single_line TYPE string,

v_msg TYPE string,

v_msg1 TYPE string.

*-- read file, split lines into fields and put data into table

OPEN DATASET v_file_return FOR INPUT IN TEXT MODE ENCODING NON-UNICODE. "Opening the files

IF sy-subrc EQ 0.

CONCATENATE text-020 v_lin INTO v_msg SEPARATED BY space.

CONCATENATE text-021 v_lin INTO v_msg1 SEPARATED BY space.

TRANSFER: v_msg TO v_file_return.

TRANSFER: v_msg1 TO v_file_return.

WRITE:/ v_msg.

WRITE:/ v_msg1.

ENDIF.

ENDFORM. " write_error_log

with regards.

sowjanya.b.

Former Member
0 Kudos

Hi ,

I hope if ui understand ur question,

QM block not triggered via EDI Orders.--> u mean no data is being populated related to QM.

Actually i didnt get what QM mean. I didnt find any QM field /flag in the specified path u mentioned.

inorder to do this , first find out the field name which field is not getting populated and search the same field in the FM:

IDOC_INPUT_ORDERS.

if it is a Custome field with user-exit , u can populate the field.

revrt back if any issues,

Regards,

naveen