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: 

report to display billing doc

Former Member
0 Kudos
251

TABLES : vbfa, vbrk.

DATA : BEGIN OF itab OCCURS 0 ,

posnv LIKE vbfa-posnv,

vbtyp_n LIKE vbfa-vbtyp_n,

vbelv LIKE vbfa-vbelv,

vbeln LIKE vbrk-vbeln,

END OF itab.

DATA : BEGIN OF itab1 OCCURS 0,

vbelv LIKE vbfa-vbelv,

flag TYPE i,

END OF itab1.

DATA lv_tabix LIKE sy-tabix.

DATA flagw TYPE i.

SELECT-OPTIONS : p_vbelv FOR vbfa-vbelv.

SELECT aposnv avbtyp_n avbelv bvbeln INTO

CORRESPONDING FIELDS OF

TABLE itab FROM ( vbfa AS a INNER JOIN vbrk AS b ON afktyp = bfktyp

)

WHERE vbelv IN p_vbelv.

IF sy-subrc = 0.

flagw = 1.

ENDIF.

SELECT DISTINCT vbelv FROM vbfa INTO

CORRESPONDING FIELDS OF

TABLE itab1

WHERE vbelv IN p_vbelv.

LOOP AT itab1.

lv_tabix = sy-tabix.

READ TABLE itab WITH KEY vbelv = itab1-vbelv

vbtyp_n = 'M' .

IF sy-subrc = 0.

itab1-flag = 1.

MODIFY itab1 INDEX lv_tabix.

ENDIF.

ENDLOOP.

START-OF-SELECTION.

IF flagw = 1.

LOOP AT itab1.

IF itab1-flag = 1.

WRITE:/1 itab1-vbelv ,

'Invoice' .

ELSE.

WRITE:/1 itab1-vbelv ,

'No Invoice' .

ENDIF.

WRITE: / 'Preceding Item',

25 'Document type',

45 'Billing Number'.

WRITE : / sy-uline.

LOOP AT itab.

IF itab-vbelv = itab1-vbelv.

WRITE : /0 itab-posnv,

27 itab-vbtyp_n,

47 itab-vbeln.

ENDIF.

ENDLOOP.

ENDLOOP.

ENDIF.

  • PERFORM line_sel.

AT LINE-SELECTION.

----


  • FORM line_sel *

----


  • ........ *

----


*FORM line_sel.

  • DATA: lv_field(20),

  • lv_value(10).

*

*

*

  • GET CURSOR FIELD lv_field.

  • IF lv_field = itab-vbeln.

  • IF NOT lv_value IS INITIAL.

  • SET PARAMETER ID 'VF' FIELD 'itab-vbeln'.

  • CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.

  • ENDIF.

  • ENDIF.

*ENDFORM.

*

DATA: g(30),

ref_parameter(30) VALUE 'parameter by reference',

val_parameter(30) VALUE 'parameter by value',

field_symbol LIKE itab-vbeln.

FIELD-SYMBOLS: <f> TYPE ANY.

*PERFORM WRITE_LIST USING REF_PARAMETER VAL_PARAMETER.

ASSIGN itab-vbeln TO <f>.

GET CURSOR VALUE g.

WRITE: / g, sy-subrc.

*FORM WRITE_LIST USING RP VALUE(VP).

  • ASSIGN itab-vbeln TO <F>.

SET PARAMETER ID 'VF' FIELD g.

CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.

  • ENDFORM.

this is my code if i click each billing document number i should get tht billing document

its not working can anyone tell me wats the error

5 REPLIES 5

Former Member
0 Kudos
94

Hi,

You have to HIDE the field ITAB-VBELN between the LOOP..endloop of ITAB.

regards,

Anji

0 Kudos
94

then also im not able to display the particular billing document which i have clicked

0 Kudos
94

na its working thanks

Former Member
0 Kudos
94

Hi Javed,

Use this code:

LOOP AT itab.

IF itab-vbelv = itab1-vbelv.

WRITE : /0 itab-posnv,

27 itab-vbtyp_n,

47 LOOP AT itab.

IF itab-vbelv = itab1-vbelv.

WRITE : /0 itab-posnv,

27 itab-vbtyp_n,

47 itab-vbeln.

HIDE itab-vbeln.

ENDIF.

ENDLOOP.

Reward is helpful,

Regards,

Tanmay

Former Member
0 Kudos
94

JUST CHECK

GET CURSOR VALUE g.

WRITE: / g, sy-subrc.

*FORM WRITE_LIST USING RP VALUE(VP).

  • ASSIGN itab-vbeln TO <F>.

SET PARAMETER ID 'VF' FIELD g.

CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.

  • ENDFORM.

PUT A BREAK POINT IN GET CURSOR AND CHECK THE VALUE OF G. THERE MAY BE SOME PROBLEM WITH LEADING ZERO IF IT IS SO USE FM CONERSION_EXIT_ALPHA_INPUT BEFORE PASSING THE VALUE TO PARAMETER ID.

REGARDS

SHIBA DUTTA