cancel
Showing results for 
Search instead for 
Did you mean: 

Problem related coding

ashish_shah5
Participant
0 Kudos

loop at gt_orderadm_h into gs_orderadm_h where process_type = 'Z501' OR process_type = 'Z116' .

wa_final-process_type = gs_orderadm_h-process_type.

wa_final-object_id = gs_orderadm_h-object_id.

wa_final-posting_date = gs_orderadm_h-posting_date.

wa_final-created_at = gs_orderadm_h-created_at .

wa_final-created_by = gs_orderadm_h-created_by .

wa_final-changed_at = gs_orderadm_h-changed_at.

wa_final-changed_by = gs_orderadm_h-changed_by.

wa_final-description = gs_orderadm_h-description.

loop at gt_partner into gs_partner where partner_fct = '00000002' or partner_fct = 'Z001'.

clear: wa_final-bp, wa_final-shp.

if gs_partner-partner_fct = '00000002'.

wa_final-shp = gs_partner-partner_no.

endif.

if gs_partner-partner_fct = 'Z001'.

wa_final-bp = gs_partner-partner_no.

endif.

endloop.

loop at gt_activity_h into gs_activity_h.

CLEAR: wa_final-category, wa_final-priority .

wa_final-category = gs_activity_h-category.

wa_final-priority = gs_activity_h-priority.

endloop.

loop at gt_refobj into gs_refobj.

CLEAR: wa_final-ib_ibase, wa_final-IB_INSTANCE , wa_final-PRODUCT_ID .

wa_final-ib_ibase = gs_refobj-ib_ibase.

wa_final-IB_INSTANCE = gs_refobj-IB_INSTANCE.

wa_final-PRODUCT_ID = gs_refobj-PRODUCT_ID.

endloop.

append wa_final to final.

endloop.

endloop.

perform build_fieldcatalog.

perform display_alv_report.

In ds all record r displaying properly except one parameters "gs_refobj".

Aftr 3 records it is piking same values in parameters "gs_refobj".

regards,

Ashish S.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Use WHERE clause for loop as per your key mappings.

LOOP AT gt_refobj INTO gs_refobj.

This will solve your problem.

Regards,

Kunjal

ashish_shah5
Participant
0 Kudos

Hi kunjal,

What I will use in where condition.

Regards,

Ashish.

Former Member
0 Kudos

Hi Ashish,

Where condition depends on the data you are selecting, on your requirements and from what tables you are selecting...

Try finding the common fields (Basically Primary keys) in all the tables you are selection data from..

Regards,

Kunjal

ashish_shah5
Participant
0 Kudos

Hi Kunjal,

I am using Function module CRM_ORDER_READ data are coming from Import parameters.

Former Member
0 Kudos

If its coming from FM then check all the fields from table to find specific relation between them..

Regards,

Kunjal

Answers (1)

Answers (1)

matt
Active Contributor
0 Kudos
LOOP AT gt_orderadm_h INTO gs_orderadm_h WHERE process_type = 'Z501' OR process_type = 'Z116' .
  wa_final-process_type = gs_orderadm_h-process_type.
  wa_final-object_id = gs_orderadm_h-object_id.
  wa_final-posting_date = gs_orderadm_h-posting_date.
  wa_final-created_at = gs_orderadm_h-created_at .
  wa_final-created_by = gs_orderadm_h-created_by .
  wa_final-changed_at = gs_orderadm_h-changed_at.
  wa_final-changed_by = gs_orderadm_h-changed_by.
  wa_final-description = gs_orderadm_h-description.

  LOOP AT gt_partner INTO gs_partner WHERE partner_fct = '00000002' OR partner_fct = 'Z001'.
    CLEAR: wa_final-bp, wa_final-shp.

    IF gs_partner-partner_fct = '00000002'.
      wa_final-shp = gs_partner-partner_no.
    ENDIF.
    IF gs_partner-partner_fct = 'Z001'.
      wa_final-bp = gs_partner-partner_no.
    ENDIF.
  ENDLOOP.
  LOOP AT gt_activity_h INTO gs_activity_h.
    CLEAR: wa_final-category, wa_final-priority .

    wa_final-category = gs_activity_h-category.
    wa_final-priority = gs_activity_h-priority.
  ENDLOOP.
  LOOP AT gt_refobj INTO gs_refobj.
    CLEAR: wa_final-ib_ibase, wa_final-ib_instance , wa_final-product_id .
    wa_final-ib_ibase = gs_refobj-ib_ibase.
    wa_final-ib_instance = gs_refobj-ib_instance.
    wa_final-product_id = gs_refobj-product_id.
  ENDLOOP.
  APPEND wa_final TO final.
ENDLOOP.

ENDLOOP.

PERFORM build_fieldcatalog.
PERFORM display_alv_report.

See how nice you can make your code look using the tags to surround it.

matt

JozsefSzikszai
Active Contributor
0 Kudos

>

> See how nice you can make your code look using the tags to surround it.

> matt

could you please improve the subject as well?

ashish_shah5
Participant
0 Kudos

Thx Matthew.

But for me rit now is to solve ds issue. Please go through it, if u can help me out.

Regards,

Ashish S.

former_member184657
Active Contributor
0 Kudos

While you are at it, pls dont forget the spell check too:

In ds all record r displaying properly except one parameters "gs_refobj".

Aftr 3 records it is piking same values in parameters "gs_refobj".

pk

matt
Active Contributor
0 Kudos

>

> Thx Matthew.

>

> But for me rit now is to solve ds issue. Please go through it, if u can help me out.

>

> Regards,

> Ashish S.

If you're clear about the problem, and people can READ your code easily, then you're more likely to get solutions.