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

Problem with copying the T-code KSB1 program

Former Member
0 Likes
1,890

Hi Guys,

I have to copy the standard report KSB1 and have to make the changes to it. But problem is when I am copying the program RKAEP000 to ZRKAEP000 and try to execute the program it gives the error “Transaction Code Does not Defined”

Then I tried to execute the standard program RKAEP000 it gave me the same error, but when I am executing through transaction code KSB1 then it is fine.

Then I tried to copy the T-code KSB1 to ZKSB1 then executed the ZKSB1, it gave me same error. Now I am not able to find where the program is checking for the t-code ZKSB1.

Will appreciate you guy’s response.

Thanks,

Rohit

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,548

See below FM,and you are getting problem in this FM.

Keep Break point in this FM or RKAEPINI ( Include ) keep break Point here.

now run your transaction.

CALL FUNCTION 'K_LINE_ITEM_LOGICAL_KEY_GET'

EXPORTING

i_tcode = v_tcode

IMPORTING

e_item_group = c_item_group

e_rep_object = c_rep_object

e_update = gd-update

EXCEPTIONS

unknow_transaction = 1.

IF sy-subrc = 1.

MESSAGE e496(kb).

ENDIF.

Reward Points if it is helpful

Thanks

Seshu

11 REPLIES 11
Read only

Former Member
0 Likes
1,548

see this piece of code in form transaction_init in include RKAEPINI.

IF sy-batch IS INITIAL OR c_item_group IS INITIAL. "note 193499

"parameters must be filled in batch mode

CALL FUNCTION 'K_LINE_ITEM_LOGICAL_KEY_GET'

EXPORTING

i_tcode = v_tcode

IMPORTING

e_item_group = c_item_group

e_rep_object = c_rep_object

e_update = gd-update

EXCEPTIONS

unknow_transaction = 1.

maybe u can just comment this check.

Read only

Former Member
0 Likes
1,548

better copy that FM to a Z function module,

and add this code.

WHEN 'ZKSB1'.

E_ITEM_GROUP = CON_ITEM_GROUP-COST_ACTUAL.

E_REP_OBJECT = OBJEKTART_KS.

and call this Z FM from your program. just to make sure it works exactly as KSB1.

Read only

Former Member
0 Likes
1,549

See below FM,and you are getting problem in this FM.

Keep Break point in this FM or RKAEPINI ( Include ) keep break Point here.

now run your transaction.

CALL FUNCTION 'K_LINE_ITEM_LOGICAL_KEY_GET'

EXPORTING

i_tcode = v_tcode

IMPORTING

e_item_group = c_item_group

e_rep_object = c_rep_object

e_update = gd-update

EXCEPTIONS

unknow_transaction = 1.

IF sy-subrc = 1.

MESSAGE e496(kb).

ENDIF.

Reward Points if it is helpful

Thanks

Seshu

Read only

0 Likes
1,548

Thank you guys it worked. Now I have to add LIFNR (Vendor) field to the output of the custom program. I have to get LIFNR for the corresponding purchase order.

Can you please let me know how to proceed to add LIFNR to the output ALV grid.

I can get the LIFNR from the EKKO table.

Appreciate your response.

Thanks,

Rohit

Read only

0 Likes
1,548

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_structure_name = c_field_structure

i_client_never_display = 'X'

CHANGING

ct_fieldcat = ct_default_fieldcat.

after this, append ur LIFNR also to field catalog.

also select from ekko and pass to the internal table which is being passed to reuse_alv_*display FM

Read only

0 Likes
1,548

Hi Sujamol,

Yeah I can do it but I am not able to find where to do changes in program RKAEP000 to make it work.

Rohit

Read only

0 Likes
1,548

How do you get the purchase order number?

Rob

Read only

0 Likes
1,548

search for this block in that.

-


this is piece existing in that program..

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_structure_name = c_field_structure

i_client_never_display = 'X'

CHANGING

ct_fieldcat = ct_default_fieldcat.

just after this add ur field catalog..to append this ct_default_fieldcat.

Was this your question ?

Read only

0 Likes
1,548

I have added the following code, but it is not adding the LIFNR column

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_structure_name = c_field_structure

i_client_never_display = 'X'

CHANGING

ct_fieldcat = ct_default_fieldcat.

ls_field_cat-col_pos = '182'.

ls_field_cat-fieldname = 'LIFNR'.

ls_field_cat-seltext_l = 'Vendor'.

APPEND ls_field_cat to ct_default_fieldcat.

Field catalog has almost 181 columns so I have added it at the 182 position. Other thing is to get the LIFNR I required the purchase order number. I am able to see the purchase order in the output but not able to find out from which internal table I have to extract it.

Read only

Former Member
0 Likes
1,548

As a start, try commenting out the call to FM K_LINE_ITEM_LOGICAL_KEY_GET, and set the values of c_item_group to COAC and c_rep_object to KS manually. And clear gd-update.

Rob

Read only

Former Member
0 Likes
1,548

Hi Rohit,

Can you please provide the steps which you followed in creating Z program and adding logic to add new fields?

Have a similar requirement.

Thanks.