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

AFVGD structure

Former Member
0 Likes
18,730

I am hoping that someone can help me with this. I need to identify time spent at different stages in a Service Order. The time spans that I need, and the data fields that I believe will give me the information, is as follows:

1.) Goods Receipt date (VBFA-ERDAT) to Sale of Repair date (LIKP-WADAT_IST)

2.) Goods Receipt date (VBFA-ERDAT) to Shipment date (VTTK-DTABF)

3.) Actual Start date (AFVGD-ISDD) to Sale of Repair date (LIKP-WADAT_IST)

4.) Actual Start date (AFVGD-ISDD) to Shipment date (VTTK-DTABF)

5.) Actual Start date (AFVGD-ISDD) to Actual Finish Date (AFVGD-IEDD)

I believe I understand how to join the tables LIKP, VBFA and VTTK to get most of the data but I do not know how to get the AFVGD data. Can someone tell me how I would do this, or if there is a better place to get this info. The following is how I am joining the tables I understand:

FORM join_data.

SELECT t0vbeln t0ernam t0erdat t0vstel t0~lfart

t0wadat t0lfdat t0route t0vbtyp t0~kunnr

t0btgew t0gewei t0lfuhr t0wadat_ist

t1tknum t1tpnum t1~tprfo

t2vbeln t2erdat AS erdat2

t3tknum t3shtyp t3exti1 t3dptbg t3~uptbg

t3tdlnr t3dtabf

t4~wbstk

into corresponding fields of table GT_JOINED_INFO

FROM ( likp AS t0

INNER JOIN vttp AS t1 ON t0vbeln = t1vbeln

INNER JOIN vbfa AS t2 ON t1vbeln = t2vbelv

INNER JOIN vttk AS t3 ON t3tknum = t2vbeln

INNER JOIN vbuk AS t4 ON t0vbeln = t4vbeln ).

  • Count of table entries

DESCRIBE TABLE GT_JOINED_INFO LINES LVI_JOINED_INFO_TBLSIZE.

*

IF LVI_JOINED_INFO_TBLSIZE > 1.

  • Sort for duplicates.

SORT GT_JOINED_INFO BY vbeln.

  • Delete duplicates.

DELETE ADJACENT DUPLICATES FROM GT_JOINED_INFO

COMPARING vbeln.

ENDIF.

  • Adjust table count

DESCRIBE TABLE GT_JOINED_INFO LINES LVI_JOINED_INFO_TBLSIZE.

ENDFORM.

Any help would be appreciated.

Thank you,

Dave

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
8,818

Hi David,

I'm afraid you cannot access AFVGD as if it were a table, 'cause it's not: it's a structure! So if you want (for example) to use field AFVGD-IEDD, you'll need to find out what table stores this data.

I have tried it myself ( I don't know anything about service orders, sorry :,-( ), but I can give you some clues:

- Enter tx SE11 and view structure AFVGD

- Double-click the data element corresponding to field IEDD (that's data element IEDD)

- Look at the cross-references of data element IEDD into tables, and you'll get a few tables

I found it very interesting, table MCAFVGV, this may help you. But sorry again, I'm just wondering as an ABAPer, not as a Service-Order-expert (as I am not...)

Anyway, I hope it could give you some clues about what you have to do. Please let us know if it helped. BR,

Alvaro

7 REPLIES 7
Read only

Former Member
0 Likes
8,819

Hi David,

I'm afraid you cannot access AFVGD as if it were a table, 'cause it's not: it's a structure! So if you want (for example) to use field AFVGD-IEDD, you'll need to find out what table stores this data.

I have tried it myself ( I don't know anything about service orders, sorry :,-( ), but I can give you some clues:

- Enter tx SE11 and view structure AFVGD

- Double-click the data element corresponding to field IEDD (that's data element IEDD)

- Look at the cross-references of data element IEDD into tables, and you'll get a few tables

I found it very interesting, table MCAFVGV, this may help you. But sorry again, I'm just wondering as an ABAPer, not as a Service-Order-expert (as I am not...)

Anyway, I hope it could give you some clues about what you have to do. Please let us know if it helped. BR,

Alvaro

Read only

0 Likes
8,818

Thank you Alvaro. I will try to track down the actual source of the data in the structure as you suggest.

Dave

Read only

Former Member
0 Likes
8,818

AFRU has the details, but I am not a service expert either, so check how your tables relate to this one. I think your VTTK has a TERNR fieldand you can pass this to AFRU-AUFNR, but again this is just a wild guess.

Srinivas

Read only

0 Likes
8,818

Thank you Srinivas. VTTK does have TERNR but in our case the field is empty. I will look into AFRU some more.

Thanks again,

Dave

Read only

franois_henrotte
Active Contributor
0 Likes
8,818

try to read directly CAUFV with AUFNR = VBAK-AUFNR

Read only

0 Likes
8,818

Thank you François - but another dead end. The AUFNR field in VBAK is also empty. I'll keep looking.

Dave

Read only

0 Likes
8,818

Try with VBAKVBELN = AUFKKDAUF.