Application Development and Automation 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: 
Read only

BDC - Creating Inspections Plans using T-Code QP01

Former Member
0 Likes
927

Hi All,

I want to Create Inspection Plans using QP01 transaction using BDC.

It having 4 screens. Third and Fourth screens having line item details.

I did recording. Upto First and second screens data is populating properly, coming to third screen data is not taking even though bdctable having data (in debug mode i found). I don't know hw to resolve this problem.

Can u please explain hw to populate line-item details, possible give some example coding .

Regards,

Prabhakar

Hi All,

I want to Create Inspection Plans using QP01 transaction using BDC.

It having 4 screens. Third and Fourth screens having line item details.

I did recording. Upto First and second screens data is populating properly, coming to third screen data is not taking even though bdctable having data (in debug mode i found). I don't know hw to resolve this problem.

Can u please explain hw to populate line-item details, possible give some example coding .

Regards,

Prabhakar

3 REPLIES 3
Read only

Former Member
0 Likes
740

Hi,

Use the BAPI BAPI_INSPECTIONPLAN_CREATE to create the Inspection plan as the recording may some times create problems if the screen sequence is not the same in QA/PRD system,

Rgds,

Read only

0 Likes
740

Hi Nagasamudram,

I don't know hw to use BAPI, bcz i am new to BAPI. Hw i will use this. Can you please explain in detail.

Doubt: If once we use BAPI, recording is necessary or not?

Urgent Please

Regards,

Prabhakar

Read only

0 Likes
740

Hi,

If you are comfortable using function modules then you will not have any difficulty in using the BAPI, only thing we need to take care of the following, refer the following this is not using the bapi for Inspection plan, this is done for different purpose, still you can refer this and use accordingly,

Data declarations,

DATA: TOPNODEONLY LIKE BAPICO_GROUP-TOPNODEONLY,

RETURN LIKE BAPIRET2,

LT_HIERARCHYNODES LIKE BAPISET_HIER OCCURS 0,

LT_HIERARCHYVALUES LIKE BAPI1117_VALUES OCCURS 0,

LS_HIERARCHYNODES LIKE BAPISET_HIER,

LS_HIERARCHYVALUES LIKE BAPI1117_VALUES,

LV_FLAG TYPE I,FLAG.

DATA: BEGIN OF ORDERS OCCURS 0,

ORDER_GROUP TYPE GRPDYNP-NAME_COALL,

DESC(30),

ORDER TYPE GRPVALUES-VFROM,

END OF ORDERS.

START-OF-SELECTION.

CALL FUNCTION 'WS_UPLOAD'

EXPORTING

FILENAME = FILENAME

FILETYPE = 'DAT'

TABLES

DATA_TAB = ORDERS.

SORT ORDERS BY ORDER_GROUP ORDER.

LOOP AT ORDERS.

IF LV_FLAG NE 1.

TRANSLATE ORDERS-ORDER_GROUP TO UPPER CASE.

LS_HIERARCHYNODES-GROUPNAME = ORDERS-ORDER_GROUP.

LS_HIERARCHYNODES-DESCRIPT = ORDERS-DESC.

LS_HIERARCHYNODES-HIERLEVEL = 0.

LS_HIERARCHYNODES-VALCOUNT = 0.

APPEND LS_HIERARCHYNODES TO LT_HIERARCHYNODES.

LV_FLAG = 1.

ENDIF.

CLEAR LS_HIERARCHYNODES.

LS_HIERARCHYNODES-GROUPNAME = ORDERS-ORDER.

LS_HIERARCHYNODES-HIERLEVEL = 1.

LS_HIERARCHYNODES-VALCOUNT = 0.

APPEND LS_HIERARCHYNODES TO LT_HIERARCHYNODES.

AT END OF ORDER_GROUP.

FLAG = 'X'.

ENDAT.

IF FLAG = 'X'.

  • BAPI is called to create Internal Order group in the system

CALL FUNCTION 'BAPI_INTERNALORDRGRP_CREATE'

TABLES

HIERARCHYNODES = LT_HIERARCHYNODES

HIERARCHYVALUES = LT_HIERARCHYVALUES.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

CLEAR : LT_HIERARCHYNODES[], LS_HIERARCHYNODES.

CLEAR : LV_FLAG,FLAG.

ENDIF.

ENDLOOP.

Hope this helps,

Rgds,