Skip to Content
Former Member
Dec 31, 2011 at 12:16 PM

get DocNum from CFL (choose from list)


Hi SAP gurus!

Wish all of you a very Happy and Prosperous New Year 2012 !

is it possible to get Document Number from List of Goods Receipt (CFL) ..?

in Landed Cost Screen, when user clicks on 'Copy From' button, i am trying to execute query based on Document Number of List Of Goods Receipt CFL (Screen No. 10019). and then assign value of GrossAmnt to textfield 'ActualCost'

but in Screen 10019, when i press 'Choose' button, value in pval.formtype is 992!

in Case statement of 10019, hence my query is not getting executed..

Does any one have any idea how can i get Document Number from CFL.?

below is my code.

'// add an event type to the container
'// this method returns an EventFilter object
    Set oFilter = oFilters.Add(et_ITEM_PRESSED)
'// aggign the form type on which the event would be processed

    oFilter.Add 992      'Landed Cost Screen
    oFilter.Add 10019  'List of Goods Receipt Screen (CFL)

in Case statement of pval.formtype

If pVal.FormType <> 0 Then
If pVal.Before_Action = False Then
Select Case pVal.FormType
case 992:
case 10019:
select case pval.eventtype
case et_item_pressed

Set o_TmpForm = SBO_Application.Forms.GetFormByTypeAndCount(pVal.FormType, pVal.FormTypeCount)
o_matrix = o_TmpForm.items.item("7").specific
set actual_cost = o_matrix.column.item("DocNum").specific.value ' actual_cost.RowCount is 0, hence runtime error.

'now passing query in below sub end sub subroutine(procedure)..

end select
end Select
end if
end if

i appreciate your help..

Thanks and Regards,